class 1 summon_siege_golem : default_npc
{
handler:
	EventHandler CREATED()
	{
		myself::AddPetDefaultDesire_Follow(20.000000);
		myself::Summon_SetOption(1,900);
		myself::AddTimerEx(100020,1000);
		myself::AddTimerEx(100021,( 1000 * 60 ));
	}

	EventHandler NO_DESIRE()
	{
		myself::AddPetDefaultDesire_Follow(20.000000);
	}

	EventHandler MENU_SELECTED(talker,ask,reply,i0,c0)
	{
		i0 = myself.master.target_id;
		if( myself::Skill_GetConsumeMP(1044225) < myself.sm.mp && myself::Skill_GetConsumeHP(1044225) < myself.sm.hp && myself::Skill_InReuseDelay(1044225) == 0 )
		{
			myself::AddUseSkillDesireEx(i0,1044225,0,reply,ask,1000000,0);
		}
	}

	EventHandler TIMER_FIRED_EX(timer_id)
	{
		if( timer_id == 100020 )
		{
			if( myself.master.alive == 0 )
			{
				myself::Despawn();
			}
			myself::AddTimerEx(100020,1000);
		}
		if( timer_id == 100021 )
		{
			if( myself::OwnItemCount(myself.master,2131) < 140 && myself::OwnItemCount(myself.master,2131) >= 70 )
			{
				myself::Say(myself::MakeFString(1000169,"","","","",""));
			}
			if( myself::OwnItemCount(myself.master,2131) >= 70 )
			{
				myself::DeleteItem1(myself.master,2131,70);
			}
			else
			{
				myself::Despawn();
			}
			myself::AddTimerEx(100021,( 1000 * 60 ));
		}
	}

}
