class 1 triyol_zzolda : warrior_aggressive_physicalspecial
{
handler:
	EventHandler ATTACKED(attacker,c1,npc0)
	{
		myself::SetCurrentQuestID(25);
		c1 = attacker;
		if( myself::FloatToInt(myself.sm.hp) <= 30 )
		{
			if( myself::HaveMemo(c1,25) == 1 && myself::GetMemoState(c1,25) == 8 && myself::OwnItemCount(c1,7158) == 0 && c1.dbid == myself.sm.param2 )
			{
				myself::GiveItem1(c1,7158,1);
				myself::SoundEffect(c1,"ItemSound.quest_itemget");
				myself::SetFlagJournal(c1,25,8);
				npc0 = gg::GetNPCFromID(myself.sm.param3);
				if( gg::IsNull(npc0) == 0 )
				{
					npc0.i_quest0 = 0;
				}
				myself::Say(myself::MakeFString(2551,"","","","",""));
				myself::Despawn();
			}
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(c0,npc0,timer_id)
	{
		myself::SetCurrentQuestID(25);
		if( timer_id == 2501 )
		{
			c0 = myself::GetCreatureFromIndex(myself.sm.param1);
			if( c0 )
			{
				myself::Say(myself::MakeFString(2550,c0.name,"","","",""));
			}
		}
		else if( timer_id == 2502 )
		{
			npc0 = gg::GetNPCFromID(myself.sm.param3);
			if( gg::IsNull(npc0) == 0 )
			{
				npc0.i_quest0 = 0;
			}
			myself::Despawn();
		}
		super;
	}

	EventHandler CREATED(c0,i0)
	{
		myself::SetCurrentQuestID(25);
		myself::AddTimerEx(2501,500);
		myself::AddTimerEx(2502,( 1000 * 120 ));
		i0 = myself.sm.param1;
		if( i0 > 0 )
		{
			c0 = myself::GetCreatureFromIndex(i0);
			if( c0 )
			{
				myself::AddAttackDesire(c0,1,20000);
			}
		}
		super;
	}

}
