Post Pacific  

Go Back   Post Pacific > Lineage 2 > Lineage 2 Server Modifications ONLY!

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 17.07.2006, 23:04   #3
Sauron
Архивный участник
 
Join Date: Feb 2005
Posts: 357
Default

this is the complete warrior class and some others ai. btw i haven't checked it for errors.

Code:
/***************************************************************************
*                                Change Log
*                            ------------------
*   xx.xx.2006
*   Script Decompiled by SauDecompiler build 160706.1
*
***************************************************************************/

class warrior : warrior_parameter
{
parameter:
	float	Attack_DecayRatio = 6.600000;
	float	UseSkill_DecayRatio = 660xx.xx0000;
	float	Attack_BoostValue = 3xx.xx0000;
	float	UseSkill_BoostValue = 1000xx.xx0000;

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

	EventHandler CREATED()
	{
		if( ShoutMsg1 > 0 )
		{
			Shout(MakeFString(ShoutMsg1,"","","","",""));
		}
		if( MoveAroundSocial > 0 || ShoutMsg2 > 0 || ShoutMsg3 > 0 )
		{
			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.c_ai2 > ( myself.sm.max_hp * 0.400000 ) && myself.sm.alive != 0 ) )
			{
				if( MoveAroundSocial > 0 || MoveAroundSocial1 > 0 || MoveAroundSocial2 > 0 )
				{
					if( MoveAroundSocial2 > 0 && Rand(100) < 20 )
					{
						AddEffectActionDesire(myself.sm,3,( ( MoveAroundSocial2 * 1000 ) / 30 ),50);
					}
					else if( MoveAroundSocial1 > 0 && Rand(100) < 20 )
					{
						AddEffectActionDesire(myself.sm,2,( ( MoveAroundSocial1 * 1000 ) / 30 ),50);
					}
					else if( MoveAroundSocial > 0 && Rand(100) < 20 )
					{
						AddEffectActionDesire(myself.sm,1,( ( MoveAroundSocial * 1000 ) / 30 ),50);
					}
				}
				if( ShoutMsg2 > 0 && Rand(1000) < 17 )
				{
					Shout(MakeFString(ShoutMsg2,"","","","",""));
				}
			}
			else if( myself.p_state == 3 )
			{
				if( ShoutMsg3 > 0 && Rand(100) < 10 )
				{
					Shout(MakeFString(ShoutMsg3,"","","","",""));
				}
			}
			AddTimerEx(1001,10000);
		}
		super;
	}

	EventHandler ATTACKED(attacker,damage,f0)
	{
		if( attacker.is_pc != 0 || IsInCategory(11,attacker.npc_class_id) )
		{
			f0 = 0;
			if( SetHateGroup >= 0 )
			{
				if( 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 ) ) ) );
			AddAttackDesire(attacker,1,( f0 * 100 ));
		}
		if( IsNullCreature(myself.top_desire_target) == 0 )
		{
			if( GetPathfindFailCount() > 10 && attacker == myself.top_desire_target && FloatToInt(myself.sm.c_ai2) != FloatToInt(myself.sm.max_hp) )
			{
				InstantTeleport(myself.sm,FloatToInt(attacker.x),FloatToInt(attacker.creature),FloatToInt(attacker.z));
			}
			if( GetAbnormalLevel(myself.sm,Skill_GetAbnormalType(307457)) >= 0 && DistFromMe(myself.top_desire_target) > 40 )
			{
				if( CanAttack(myself.top_desire_target) == 1 )
				{
					if( attacker.is_pc != 0 || IsInCategory(11,attacker.npc_class_id) )
					{
						f0 = 0;
						if( SetHateGroup >= 0 )
						{
							if( 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 ) ) ) );
						AddAttackDesire(attacker,1,( f0 * 100 ));
					}
				}
				else
				{
					RemoveAttackDesire(myself.top_desire_target.id);
					if( attacker.is_pc != 0 || IsInCategory(11,attacker.npc_class_id) )
					{
						f0 = 0;
						if( SetHateGroup >= 0 )
						{
							if( 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 ) ) ) );
						AddAttackDesire(attacker,1,( f0 * 100 ));
					}
				}
			}
		}
		super;
	}

	EventHandler CLAN_ATTACKED(attacker,damage,f0)
	{
		if( GetLifeTime() > 7 )
		{
			if( IsNullCreature(myself.top_desire_target) == 0 )
			{
				if( GetPathfindFailCount() > 10 && attacker == myself.top_desire_target && FloatToInt(myself.sm.hp) != FloatToInt(myself.sm.max_hp) )
				{
					InstantTeleport(myself.sm,FloatToInt(attacker.x),FloatToInt(attacker.creature),FloatToInt(attacker.z));
				}
			}
			if( attacker.is_pc != 0 || IsInCategory(11,attacker.npc_class_id) )
			{
				f0 = 0;
				if( SetHateGroup >= 0 )
				{
					if( 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 ) ) ) );
				AddAttackDesire(attacker,1,( f0 * 30 ));
			}
		}
	}

	EventHandler SEE_SPELL(speller,skill_name_id,target,f0,i0)
	{
		if( Skill_GetEffectPoint(skill_name_id) > 0 )
		{
			if( myself.p_state == 3 && myself.top_desire_target == target )
			{
				i0 = Skill_GetEffectPoint(skill_name_id);
				f0 = 0;
				if( SetHateGroup >= 0 )
				{
					if( 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 ) ) ) );
				AddAttackDesire(speller,1,( f0 * 150 ));
			}
		}
		if( GetPathfindFailCount() > 10 && speller == myself.top_desire_target && FloatToInt(myself.sm.hp) != FloatToInt(myself.sm.max_hp) )
		{
			InstantTeleport(myself.sm,FloatToInt(speller.x),FloatToInt(speller.y),FloatToInt(speller.z));
		}
	}

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

	EventHandler MY_DYING()
	{
		if( ShoutMsg4 > 0 && Rand(100) < 30 )
		{
			Shout(MakeFString(ShoutMsg4,"","","","",""));
		}
	}

}




/***************************************************************************
*                                C4 stuff
*                            ------------------
*   -----------
*   FUNCTIONS:
*   -----------
*   IsNullCreature
*   GetPathfindFailCount
*   CanAttack
***************************************************************************/
Code:
/***************************************************************************
*                                Change Log
*                            ------------------
*   xx.xx.2006
*   Script Decompiled by SauDecompiler build 160706.1
*
***************************************************************************/

class warrior_casting_ddmagic : warrior
{
parameter:
	int	DDMagic = 1024257;

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

	EventHandler ATTACKED(attacker,damage,i6)
	{
		if( myself.i_ai1 == 1 )
		{
			if( myself.top_desire_target == attacker )
			{
				myself.i_ai2 = 1;
			}
		}
		else
		{
			AddTimerEx(2001,5000);
			myself.i_ai1 = 1;
		}
		if( attacker.is_pc != 0 || IsInCategory(11,attacker.npc_class_id) )
		{
			i6 = Rand(100);
			if( DistFromMe(attacker) > 100 )
			{
				if( IsNullCreature(myself.top_desire_target) == 0 )
				{
					if( myself.top_desire_target == attacker && i6 < 33 )
					{
						if( Skill_GetConsumeMP(DDMagic) < myself.sm.c_ai3 && Skill_GetConsumeHP(DDMagic) < myself.sm.c_ai2 && Skill_InReuseDelay(DDMagic) == 0 )
						{
							AddUseSkillDesire(attacker,DDMagic,0,1,1000000);
						}
					}
				}
			}
		}
		super;
	}

	EventHandler CLAN_ATTACKED(attacker,damage,i6)
	{
		if( ( GetLifeTime() > 7 && ( attacker.is_pc != 0 || IsInCategory(11,attacker.npc_class_id) ) ) && myself.p_state != 3 )
		{
			i6 = Rand(100);
			if( DistFromMe(attacker) > 100 && i6 < 33 )
			{
				if( Skill_GetConsumeMP(DDMagic) < myself.sm.mp && Skill_GetConsumeHP(DDMagic) < myself.sm.hp && Skill_InReuseDelay(DDMagic) == 0 )
				{
					AddUseSkillDesire(attacker,DDMagic,0,1,1000000);
				}
			}
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id)
	{
		if( timer_id == 2001 )
		{
			if( myself.p_state != 3 && myself.p_state != 10 )
			{
				myself.i_ai1 = 0;
				myself.i_ai2 = 0;
			}
			else if( myself.i_ai2 == 0 )
			{
				if( IsNullCreature(myself.top_desire_target) == 0 && Rand(100) < 50 )
				{
					if( GetAbnormalLevel(myself.top_desire_target,Skill_GetAbnormalType(DDMagic)) <= 0 )
					{
						if( Skill_GetConsumeMP(DDMagic) < myself.sm.c_ai3 && Skill_GetConsumeHP(DDMagic) < myself.sm.c_ai2 && Skill_InReuseDelay(DDMagic) == 0 )
						{
							AddUseSkillDesire(myself.top_desire_target,DDMagic,0,1,1000000);
						}
					}
				}
			}
			AddTimerEx(2001,5000);
			myself.i_ai2 = 0;
		}
		super;
	}

}




/***************************************************************************
*                                C4 stuff
*                            ------------------
*   -----------
*   FUNCTIONS:
*   -----------
*   IsNullCreature
***************************************************************************/
Code:
/***************************************************************************
*                                Change Log
*                            ------------------
*   xx.xx.2006
*   Script Decompiled by SauDecompiler build 160706.1
*
***************************************************************************/

class warrior_casting_curse : warrior
{
parameter:
	int	DeBuff = 1033473;

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

	EventHandler ATTACKED(attacker,damage)
	{
		if( myself.i_ai1 == 1 )
		{
			if( myself.top_desire_target == attacker )
			{
				myself.i_ai2 = 1;
			}
		}
		else
		{
			AddTimerEx(2001,5000);
			myself.i_ai1 = 1;
		}
		if( attacker.is_pc != 0 || IsInCategory(11,attacker.npc_class_id) )
		{
			if( IsNullCreature(myself.top_desire_target) == 0 )
			{
				if( Rand(100) < 33 && GetAbnormalLevel(attacker,Skill_GetAbnormalType(DeBuff)) <= 0 && myself.top_desire_target == attacker )
				{
					if( Skill_GetConsumeMP(DeBuff) < myself.sm.c_ai3 && Skill_GetConsumeHP(DeBuff) < myself.sm.c_ai2 && Skill_InReuseDelay(DeBuff) == 0 )
					{
						AddUseSkillDesire(attacker,DeBuff,0,1,1000000);
					}
				}
			}
		}
		super;
	}

	EventHandler CLAN_ATTACKED(attacker,damage)
	{
		if( GetLifeTime() > 7 && ( attacker.is_pc != 0 || IsInCategory(11,attacker.npc_class_id) ) )
		{
			if( Rand(100) < 33 && GetAbnormalLevel(attacker,Skill_GetAbnormalType(DeBuff)) <= 0 )
			{
				if( Skill_GetConsumeMP(DeBuff) < myself.sm.mp && Skill_GetConsumeHP(DeBuff) < myself.sm.hp && Skill_InReuseDelay(DeBuff) == 0 )
				{
					AddUseSkillDesire(attacker,DeBuff,0,1,1000000);
				}
			}
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id)
	{
		if( timer_id == 2001 )
		{
			if( myself.p_state != 3 && myself.p_state != 10 )
			{
				myself.i_ai1 = 0;
				myself.i_ai2 = 0;
			}
			else if( myself.i_ai2 == 0 )
			{
				if( IsNullCreature(myself.top_desire_target) == 0 && Rand(100) < 50 )
				{
					if( GetAbnormalLevel(myself.top_desire_target,Skill_GetAbnormalType(DeBuff)) <= 0 )
					{
						if( Skill_GetConsumeMP(DeBuff) < myself.sm.c_ai3 && Skill_GetConsumeHP(DeBuff) < myself.sm.c_ai2 && Skill_InReuseDelay(DeBuff) == 0 )
						{
							AddUseSkillDesire(myself.top_desire_target,DeBuff,0,1,1000000);
						}
					}
				}
			}
			AddTimerEx(2001,5000);
			myself.i_ai2 = 0;
		}
		super;
	}

}




/***************************************************************************
*                                C4 stuff
*                            ------------------
*   -----------
*   FUNCTIONS:
*   -----------
*   IsNullCreature
***************************************************************************/
Sauron is offline  
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:51.