class 1 warrior : warrior_parameter
{
parameter:
	float	Attack_DecayRatio = 6.600000;
	float	UseSkill_DecayRatio = 66000.000000;
	float	Attack_BoostValue = 300.000000;
	float	UseSkill_BoostValue = 100000.000000;
	int	PaperRed = 4029;
	int	PaperOrange = 4030;
	int	PaperYellow = 4031;
	int	PaperGreen = 4032;
	int	PaperBlue = 4033;
	int	PaperPurple = 4034;
	int	PaperWhite = 4035;
	int	PaperBlack = 4036;
	int	Per4 = 21600;
	int	EventStart = 0;
	int	VerDropOne = 30;
	int	VerDrop1 = 10;
	int	VerDrop2 = 15;
	int	VerDrop3 = 20;
	int	VerDrop4 = 25;
	int	VerDrop5 = 30;
	int	VerDrop6 = 35;
	int	VerDrop7 = 45;
	int	VerDrop8 = 50;
	int	LevelDif = 4;

handler:
	EventHandler NO_DESIRE()
	{
		myself::AddMoveAroundDesire(5,5);
	}

	EventHandler CREATED()
	{
		if( ShoutMsg1 > 0 )
		{
			myself::Shout(myself::MakeFString(ShoutMsg1,"","","","",""));
		}
		if( MoveAroundSocial > 0 || ShoutMsg2 > 0 || ShoutMsg3 > 0 )
		{
			myself::AddTimerEx(1001,10000);
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id)
	{
		if( timer_id == 1001 )
		{
			if( ( myself.p_state == 1 || myself.p_state == 2 || myself.p_state == 9 ) && myself.sm.hp > ( myself.sm.max_hp * 0.400000 ) && myself.sm.alive != 0 )
			{
				if( MoveAroundSocial > 0 || MoveAroundSocial1 > 0 || MoveAroundSocial2 > 0 )
				{
					if( MoveAroundSocial2 > 0 && gg::Rand(100) < 20 )
					{
						myself::AddEffectActionDesire(myself.sm,3,( ( MoveAroundSocial2 * 1000 ) / 30 ),50);
					}
					else if( MoveAroundSocial1 > 0 && gg::Rand(100) < 20 )
					{
						myself::AddEffectActionDesire(myself.sm,2,( ( MoveAroundSocial1 * 1000 ) / 30 ),50);
					}
					else if( MoveAroundSocial > 0 && gg::Rand(100) < 20 )
					{
						myself::AddEffectActionDesire(myself.sm,1,( ( MoveAroundSocial * 1000 ) / 30 ),50);
					}
				}
				if( ShoutMsg2 > 0 && gg::Rand(1000) < 17 )
				{
					myself::Shout(myself::MakeFString(ShoutMsg2,"","","","",""));
				}
			}
			else if( myself.p_state == 3 )
			{
				if( ShoutMsg3 > 0 && gg::Rand(100) < 10 )
				{
					myself::Shout(myself::MakeFString(ShoutMsg3,"","","","",""));
				}
			}
			myself::AddTimerEx(1001,10000);
		}
		super;
	}

	EventHandler ATTACKED(attacker,damage,f0)
	{
		if( attacker.is_pc != 0 || myself::IsInCategory(11,attacker.npc_class_id) )
		{
			f0 = 0;
			if( SetHateGroup >= 0 )
			{
				if( myself::IsInCategory(SetHateGroup,attacker.occupation) )
				{
					f0 = ( f0 + SetHateGroupRatio );
				}
			}
			if( attacker.occupation == SetHateOccupation )
			{
				f0 = ( f0 + SetHateOccupationRatio );
			}
			if( SetHateRace == attacker.race )
			{
				f0 = ( f0 + SetHateRaceRatio );
			}
			f0 = ( ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) ) );
			myself::AddAttackDesire(attacker,1,( f0 * 100 ));
		}
		if( myself::IsNullCreature(myself.top_desire_target) == 0 )
		{
			if( myself::GetPathfindFailCount() > 10 && attacker == myself.top_desire_target && myself::FloatToInt(myself.sm.hp) != myself::FloatToInt(myself.sm.max_hp) )
			{
				myself::InstantTeleport(myself.sm,myself::FloatToInt(attacker.x),myself::FloatToInt(attacker.y),myself::FloatToInt(attacker.z));
			}
			if( myself::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(307457)) >= 0 && myself::DistFromMe(myself.top_desire_target) > 40 )
			{
				if( myself::CanAttack(myself.top_desire_target) == 1 )
				{
					if( attacker.is_pc != 0 || myself::IsInCategory(11,attacker.npc_class_id) )
					{
						f0 = 0;
						if( SetHateGroup >= 0 )
						{
							if( myself::IsInCategory(SetHateGroup,attacker.occupation) )
							{
								f0 = ( f0 + SetHateGroupRatio );
							}
						}
						if( attacker.occupation == SetHateOccupation )
						{
							f0 = ( f0 + SetHateOccupationRatio );
						}
						if( SetHateRace == attacker.race )
						{
							f0 = ( f0 + SetHateRaceRatio );
						}
						f0 = ( ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) ) );
						myself::AddAttackDesire(attacker,1,( f0 * 100 ));
					}
				}
				else
				{
					myself::RemoveAttackDesire(myself.top_desire_target.id);
					if( attacker.is_pc != 0 || myself::IsInCategory(11,attacker.npc_class_id) )
					{
						f0 = 0;
						if( SetHateGroup >= 0 )
						{
							if( myself::IsInCategory(SetHateGroup,attacker.occupation) )
							{
								f0 = ( f0 + SetHateGroupRatio );
							}
						}
						if( attacker.occupation == SetHateOccupation )
						{
							f0 = ( f0 + SetHateOccupationRatio );
						}
						if( SetHateRace == attacker.race )
						{
							f0 = ( f0 + SetHateRaceRatio );
						}
						f0 = ( ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) ) );
						myself::AddAttackDesire(attacker,1,( f0 * 100 ));
					}
				}
			}
		}
		super;
	}

	EventHandler CLAN_ATTACKED(attacker,damage,f0)
	{
		if( myself::GetLifeTime() > 7 )
		{
			if( myself::IsNullCreature(myself.top_desire_target) == 0 )
			{
				if( myself::GetPathfindFailCount() > 10 && attacker == myself.top_desire_target && myself::FloatToInt(myself.sm.hp) != myself::FloatToInt(myself.sm.max_hp) )
				{
					myself::InstantTeleport(myself.sm,myself::FloatToInt(attacker.x),myself::FloatToInt(attacker.y),myself::FloatToInt(attacker.z));
				}
			}
			if( attacker.is_pc != 0 || myself::IsInCategory(11,attacker.npc_class_id) )
			{
				f0 = 0;
				if( SetHateGroup >= 0 )
				{
					if( myself::IsInCategory(SetHateGroup,attacker.occupation) )
					{
						f0 = ( f0 + SetHateGroupRatio );
					}
				}
				if( attacker.occupation == SetHateOccupation )
				{
					f0 = ( f0 + SetHateOccupationRatio );
				}
				if( SetHateRace == attacker.race )
				{
					f0 = ( f0 + SetHateRaceRatio );
				}
				f0 = ( ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) ) );
				myself::AddAttackDesire(attacker,1,( f0 * 30 ));
			}
		}
	}

	EventHandler SEE_SPELL(speller,skill_name_id,target,f0,i0)
	{
		if( myself::Skill_GetEffectPoint(skill_name_id) > 0 )
		{
			if( myself.p_state == 3 && myself.top_desire_target == target )
			{
				i0 = myself::Skill_GetEffectPoint(skill_name_id);
				f0 = 0;
				if( SetHateGroup >= 0 )
				{
					if( myself::IsInCategory(SetHateGroup,speller.occupation) )
					{
						f0 = ( f0 + SetHateGroupRatio );
					}
				}
				if( speller.occupation == SetHateOccupation )
				{
					f0 = ( f0 + SetHateOccupationRatio );
				}
				if( SetHateRace == speller.race )
				{
					f0 = ( f0 + SetHateRaceRatio );
				}
				f0 = ( ( ( 1.000000 * i0 ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * i0 ) / ( myself.sm.level + 7 ) ) ) );
				myself::AddAttackDesire(speller,1,( f0 * 150 ));
			}
		}
		if( myself::GetPathfindFailCount() > 10 && speller == myself.top_desire_target && myself::FloatToInt(myself.sm.hp) != myself::FloatToInt(myself.sm.max_hp) )
		{
			myself::InstantTeleport(myself.sm,myself::FloatToInt(speller.x),myself::FloatToInt(speller.y),myself::FloatToInt(speller.z));
		}
	}

	EventHandler DESIRE_MANIPULATION(speller,desire)
	{
		myself::MakeAttackEvent(speller,desire,0);
	}

	EventHandler MY_DYING()
	{
		if( ShoutMsg4 > 0 && gg::Rand(100) < 30 )
		{
			myself::Shout(myself::MakeFString(ShoutMsg4,"","","","",""));
		}
		if( EventStart == 1 )
		{
			target = myself::GetLastAttacker();
			if( target.master )
			{
				target = target.master;
			}
			if( myself::HaveMemo(target,9997) == 1 && myself::GetMemoState(target,9997) == 3 )
			{
				i0 = ( gg::GetTimeOfDay() - myself::GetMemoStateEx(target,9997,1) );
				i1 = ( target.level - myself.sm.level );
				if( i0 < Per4 && i1 < LevelDif && gg::Rand(100) < VerDropOne )
				{
					if( gg::Rand(100) < VerDrop1 )
					{
						myself::DropItem1(target,PaperRed,1);
					}
					if( gg::Rand(100) < VerDrop2 )
					{
						myself::DropItem1(target,PaperOrange,1);
					}
					if( gg::Rand(100) < VerDrop3 )
					{
						myself::DropItem1(target,PaperYellow,1);
					}
					if( gg::Rand(100) < VerDrop4 )
					{
						myself::DropItem1(target,PaperBlue,1);
					}
					if( gg::Rand(100) < VerDrop5 )
					{
						myself::DropItem1(target,PaperGreen,1);
					}
					if( gg::Rand(100) < VerDrop6 )
					{
						myself::DropItem1(target,PaperPurple,1);
					}
					if( gg::Rand(100) < VerDrop7 )
					{
						myself::DropItem1(target,PaperWhite,1);
					}
					if( gg::Rand(100) < VerDrop8 )
					{
						myself::DropItem1(target,PaperBlack,1);
					}
				}
			}
		}
	}

}
