class 1 ol_mahum_betrayer : warrior_passive
{
handler:
	EventHandler MY_DYING(always_list,c1,code_info,i9,last_attacker,lparty,member,random1_list,target)
	{
		always_list = gg::AllocCodeInfoList();
		random1_list = gg::AllocCodeInfoList();
		target = last_attacker;
		always_list::SetInfo(0,target);
		while( gg::IsNull(code_info = always_list::Next()) == 0 )
		{
			if( code_info.code == 0 )
			{
				myself::SetCurrentQuestID(227);
				target = code_info::RandomSelectOne();
				if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 )
				{
					c1 = myself::GetLastAttacker();
					if( c1.master )
					{
						c1 = c1.master;
					}
					if( myself::HaveMemo(c1,227) == 1 && myself::GetMemoState(c1,227) == 8 )
					{
						myself::SetMemoState(c1,227,9);
						myself::GiveItem1(c1,2833,1);
						myself::SoundEffect(c1,"ItemSound.quest_itemget");
						myself::SetFlagJournal(c1,227,9);
					}
				}
			}
		}
		code_info = random1_list::RandomSelectOne();
		if( gg::IsNull(code_info) == 0 )
		{
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id)
	{
		myself::SetCurrentQuestID(227);
		if( timer_id == 7778 )
		{
			if( myself.i_quest0 < 12 )
			{
				myself.i_quest0 = ( myself.i_quest0 + 1 );
				myself::AddTimerEx(7778,( 1000 * 5 ));
			}
			else
			{
				myself::Despawn();
			}
		}
		super;
	}

	EventHandler CREATED()
	{
		myself::SetCurrentQuestID(227);
		myself::AddTimerEx(7778,( 1000 * 5 ));
		myself.i_quest0 = 0;
		myself::AddMoveToDesire(-7732,36787,-3709,10000);
		super;
	}

}
