nearby.// Once it has won, it returns to its home.// Memory Cells:
// Cell 0 - If 0, default behavior. If 1, it doesn�t fidget.// Cell 1,2 - Stuff done flag. If both 0, nothing. Otherwise when this is killed, set to 1.// Cell 3 - Number of state when talked to. Plays default text if 0.begincreaturescript;
variables;
short i,target;
short mode = 0;
short goin = 0;
body;
beginstate INIT_STATE;
set_name(ME,"Ivo");
set_walk_speed(ME,18);
if (my_number() == 64) mode = 1;
if (gf(13,64) > 0) erase_char(ME);
break;
beginstate DEAD_STATE;
if ((get_memory_cell(1) != 0) || (get_memory_cell(2) != 0)) inc_flag(get_memory_cell(1),get_memory_cell(2),1);
break;
beginstate START_STATE;
if ((mode == 0) && (goin > 0)) { if (dist_to_nav_point(ME,0) > 1) approach_nav_point(ME,0,1);
else { if (get_nearest_party_char(3) >= 0) { set_top_string("Ivo manages, with difficulty, to climb the stairs.");
spawn_creature(64);
erase_char(ME);
end();
} } } if (mode == 1) { if (goin == 0) { if (get_nearest_party_char(3) >= 0) goin = 1;
} else if (goin == 1) { if (dist_to_nav_point(ME,1) > 1) approach_nav_point(ME,1,1);
else goin = 2;
} else { if (get_nearest_party_char(3) >= 0) { begin_talk_mode(71);
} } } if (am_i_doing_action() == FALSE) end_combat_turn();
break;
beginstate 3;
// attacking if (target_ok() == FALSE) set_state(START_STATE);
do_attack();
break;
beginstate TALKING_STATE;
if ((mode > 0) || (goin > 0)) { print_str("Talking:
Ivo stumbles past you. He is determined to do whatever it is he is doing.");
} else { goin = 1;
talk_no_exit(70);
}break;