begincreaturescript;
variables;
short i,target;
body;
beginstate INIT_STATE;
if (get_memory_cell(5) == 0)
set_mobility(ME,0);
if(get_memory_cell(0) == 0)
set_memory_cell(0,3);
if(get_memory_cell(4) == 1){
change_spell_level(ME,0,2,-1 * get_spell_level(ME,0,2));
change_spell_level(ME,0,8,-1 * get_spell_level(ME,0,8));
change_spell_level(ME,0,14,-1 * get_spell_level(ME,0,14));
change_spell_level(ME,0,17,-1 * get_spell_level(ME,0,17));
change_spell_level(ME,1,6,-1 * get_spell_level(ME,1,6));
change_spell_level(ME,1,19,-1 * get_spell_level(ME,1,19));
}
break;
beginstate DEAD_STATE;
if ((get_memory_cell(1) != 0) || (get_memory_cell(2) != 0))
set_flag(get_memory_cell(1),get_memory_cell(2),1);
break;
beginstate START_STATE;
if (select_target(ME,8,0)) {
target = get_target();
i = get_memory_cell(0);
set_state(4);
}
if (who_hit_me() >= 0) {
set_target(ME,who_hit_me());
do_attack_tactic(2);
set_state(3);
}
if (am_i_doing_action() == FALSE)
end_combat_turn();
break;
beginstate 3;
if (target_ok() == FALSE)
set_state(START_STATE);
do_attack_tactic(2);
break;
beginstate TALKING_STATE;
if (get_memory_cell(3) == 0) {
print_str("Talking: It doesn't respond.");
end();
}
begin_talk_mode(get_memory_cell(3));
break;
beginstate 4;
if (who_hit_me() >= 0) {
set_target(ME,who_hit_me());
set_state_continue(3);
}
if(target_ok() && target == get_target()){
i = i - 1;
if(i == 0)
set_state_continue(3);
end_combat_turn();
}
else
set_state(START_STATE);
break