@LabelIndex 227000
@StringIndex 27194
class 0 defender_azrael5 : warrior_aggressive {
handler:
	EventHandler ATTACKED(attacker,c0,c1,i0,i1,npc0) {
		myself::SetCurrentQuestID(83);
		c1 = attacker;
		if( c1.master ) {
			c1 = c1.master;
		}
		i0 = myself.sm.param3;
		if( i0 > 0 ) {
			c0 = myself::Maker_FindNpcByKey(i0);
			if( c0 ) {
				myself::AddAttackDesire(c0,1,100000);
			}
		}
		if( gg::HaveMemo(c1,83) == 1 && c1.occupation == 24 && ( gg::GetMemoState(c1,83) == 13 || gg::GetMemoState(c1,83) == 14 ) ) {
			if( c1.is_pc == 1 ) {
				if( c1.dbid == myself.sm.param2 ) {
					myself.i_quest0 = ( myself.i_quest0 + 1 );
					if( myself.i_quest0 == 1 ) {
						if( c1.is_pc == 1 ) {
							myself::Say(gg::MakeFString(8366,c1.name,"","","",""));
						}
					}
					if( myself.i_quest0 > 15 ) {
						myself::SetMemoState(c1,83,14);
						if( c1.is_pc == 1 ) {
							myself::Say(gg::MakeFString(8367,c1.name,"","","",""));
						}
						c0 = myself::Maker_FindNpcByKey(myself.sm.param3);
						npc0 = gg::GetNPCFromID(c0.id);
						if( gg::IsNull(npc0) == 0 ) {
							npc0.i_quest0 = 1;
						}
						myself::Despawn();
					}
				}
			}
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(c0,i0,npc0,timer_id) {
		myself::SetCurrentQuestID(83);
		if( timer_id == 99906 ) {
			i0 = myself.sm.param3;
			if( i0 > 0 ) {
				c0 = myself::Maker_FindNpcByKey(i0);
				if( c0 ) {
					myself::AddAttackDesire(c0,1,100000);
					myself::Say(gg::MakeFString(8364,"","","","",""));
				} else {
					myself::AddTimerEx(99906,500);
				}
			}
		} else if( timer_id == 99907 ) {
			myself::Say(gg::MakeFString(8365,"","","","",""));
			c0 = myself::Maker_FindNpcByKey(myself.sm.param3);
			npc0 = gg::GetNPCFromID(c0.id);
			if( gg::IsNull(npc0) == 0 ) {
				npc0.i_quest0 = 2;
			}
			myself::Despawn();
		}
		super;
	}

	EventHandler CREATED() {
		myself::SetCurrentQuestID(83);
		myself::AddTimerEx(99906,500);
		myself::AddTimerEx(99907,( 1000 * ( 60 - 1 ) ));
		super;
	}

}
