class 1 warrior_change_weapon_physicalspecial : warrior_physicalspecial
{
parameter:
	int	EquipWeapon = 129;
	int	SelfBuff = 1031169;

handler:
	EventHandler CREATED()
	{
		myself.i_ai0 = 0;
		super;
	}

	EventHandler ATTACKED(attacker,damage,i0)
	{
		i0 = ( 50 + gg::Rand(20) );
		if( myself::FloatToInt(( ( myself.sm.hp / myself.sm.max_hp ) * 100 )) < i0 && myself.i_ai0 == 0 )
		{
			myself::EquipItem(EquipWeapon);
			if( myself::Skill_GetConsumeMP(SelfBuff) < myself.sm.mp && myself::Skill_GetConsumeHP(SelfBuff) < myself.sm.hp && myself::Skill_InReuseDelay(SelfBuff) == 0 )
			{
				myself::AddUseSkillDesire(myself.sm,SelfBuff,1,1,1000000);
			}
			myself.i_ai0 = 1;
		}
		if( myself.i_ai0 == 1 )
		{
			myself::UseSoulShot(SoulShot);
		}
		super;
	}

}
