@LabelIndex 62182
@StringIndex 0
class 0 ai_boss08_follower_of_frintessa_tran_decide_action : ai_boss08_follower_of_frintessa_tran_set_db {
parameter:

handler:
	EventHandler CREATED(reply) {
		super;
		myself.i_ai1 = 0;
		myself.i_ai3 = 0;
		myself.i_ai4 = 0;
		myself.i_ai2 = 0;
		myself.i_quest0 = 0;
		myself.i_quest1 = myself::GetCurrentTick();
		if( myself.i_ai0 == 7 ) {
			myself::AddTimerEx(3000,( 60 * 1000 ));
		}
	}

	EventHandler ATTACKED(attacker,damage,i0,i1,plist0,pos0,i2,c0) {
		myself.i_quest1 = myself::GetCurrentTick();
		if( myself.sm.hp < ( myself.sm.max_hp * 0.750000 ) ) {
			i2 = myself::GetGlobalMap(4);
			c0 = gg::GetCreatureFromIndex(i2);
			if( myself::IsNullCreature(c0) == 0 ) {
				gg::SendScriptEvent(c0,gg::GetIndexFromCreature(myself.sm),30021);
			}
			myself.i_ai4 = 30021;
		} else if( myself.sm.hp < ( myself.sm.max_hp * 0.500000 ) ) {
			i2 = myself::GetGlobalMap(4);
			c0 = gg::GetCreatureFromIndex(i2);
			if( myself::IsNullCreature(c0) == 0 ) {
				gg::SendScriptEvent(c0,gg::GetIndexFromCreature(myself.sm),30022);
			}
			myself.i_ai4 = 30022;
		} else if( myself.sm.hp < ( myself.sm.max_hp * 0.250000 ) ) {
			i2 = myself::GetGlobalMap(4);
			c0 = gg::GetCreatureFromIndex(i2);
			if( myself::IsNullCreature(c0) == 0 ) {
				gg::SendScriptEvent(c0,gg::GetIndexFromCreature(myself.sm),30023);
			}
			myself.i_ai4 = 30023;
		} else {
			i2 = myself::GetGlobalMap(4);
			c0 = gg::GetCreatureFromIndex(i2);
			if( myself::IsNullCreature(c0) == 0 ) {
				gg::SendScriptEvent(c0,gg::GetIndexFromCreature(myself.sm),30024);
			}
			myself.i_ai4 = 30024;
		}
	}

	EventHandler TIMER_FIRED_EX(timer_id,i0,i1,c0) {
		super;
		if( timer_id == 3000 ) {
			if( myself.i_ai0 == 7 ) {
				if( ( myself::GetCurrentTick() - myself.i_quest1 ) > ( 15 * 60 ) ) {
					myself::SetDBValue(myself.sm,0);
					i1 = myself::GetGlobalMap(4);
					c0 = gg::GetCreatureFromIndex(i1);
					if( myself::IsNullCreature(c0) == 0 ) {
						gg::SendScriptEvent(c0,gg::GetIndexFromCreature(myself.sm),0);
					} else {
					}
					i1 = myself::GetGlobalMap(5);
					c0 = gg::GetCreatureFromIndex(i1);
					if( myself::IsNullCreature(c0) == 0 ) {
						gg::SendScriptEvent(c0,gg::GetIndexFromCreature(myself.sm),0);
					} else {
					}
					myself::MPCC_SetMasterPartyRouting(myself.int_list::Get(0),myself.sm,0);
					myself.int_list::Clear();
					myself::RemoveAllDesire();
					myself::StopMove();
					myself::InstantTeleportInMyTerritory(150037,-57255,-2976,150);
					gg::InstantTeleportEx(myself.sm,-105200,-253104,-15264,16384);
					myself::RemoveAllAttackDesire();
					myself.i_quest2 = 0;
					myself.i_quest3 = 0;
					myself.i_quest4 = 0;
				} else {
					myself::LookNeighbor(2000);
					myself::AddTimerEx(3000,( 60 * 1000 ));
				}
			}
		}
	}

	EventHandler NO_DESIRE(damage,i0,i1,i2,c2,i3,c3) {
		if( myself.i_ai4 == 1 ) {
			myself::LookNeighbor(1000);
		} else {
			myself::LookNeighbor(2000);
		}
		super;
	}

}
