Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class 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 territory_tp_timer = 1200000;
- int territory_tp_timer_id = 9999;
- handler:
- EventHandler NO_DESIRE()
- {
- myself.AddMoveAroundDesire(5,5);
- }
- EventHandler OUT_OF_TERRITORY()
- {
- myself.AddTimerEx(territory_tp_timer_id,territory_tp_timer);
- }
- EventHandler CREATED()
- {
- if( ShoutMsg1 > 0 )
- {
- if( IsSay == 0 )
- {
- myself.Shout(MakeFString(ShoutMsg1,"","","","",""));
- }
- else
- {
- myself.Say(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 && Rand(100) < 20 )
- {
- myself.AddEffectActionDesire(myself.sm,3,( ( MoveAroundSocial2 * 1000 ) / 30 ),50);
- }
- else if( MoveAroundSocial1 > 0 && Rand(100) < 20 )
- {
- myself.AddEffectActionDesire(myself.sm,2,( ( MoveAroundSocial1 * 1000 ) / 30 ),50);
- }
- else if( MoveAroundSocial > 0 && Rand(100) < 20 )
- {
- myself.AddEffectActionDesire(myself.sm,1,( ( MoveAroundSocial * 1000 ) / 30 ),50);
- }
- }
- if( ShoutMsg2 > 0 && Rand(1000) < 17 )
- {
- if( IsSay == 0 )
- {
- myself.Shout(MakeFString(ShoutMsg2,"","","","",""));
- }
- else
- {
- myself.Say(MakeFString(ShoutMsg2,"","","","",""));
- }
- }
- }
- else if( myself.p_state == 3 )
- {
- if( ShoutMsg3 > 0 && Rand(100) < 10 )
- {
- if( IsSay == 0 )
- {
- myself.Shout(MakeFString(ShoutMsg3,"","","","",""));
- }
- else
- {
- myself.Say(MakeFString(ShoutMsg3,"","","","",""));
- }
- }
- }
- myself.AddTimerEx(1001,10000);
- }
- if( timer_id == territory_tp_timer_id )
- {
- if( myself.InMyTerritory(myself.sm) == 0 )
- {
- myself.InstantTeleport(myself.sm,myself.start_x,myself.hp,myself.start_z);
- myself.RemoveAllAttackDesire();
- }
- }
- super;
- }
- EventHandler ATTACKED(attacker,damage,f0)
- {
- if( attacker.is_pc != 0 || myself.IsInCategory(12,attacker.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 && FloatToInt(myself.sm.hp) != FloatToInt(myself.sm.max_hp) )
- {
- myself.InstantTeleport(myself.sm,FloatToInt(attacker.x),FloatToInt(attacker.y),FloatToInt(attacker.z));
- }
- if( GetAbnormalLevel(myself.sm,myself.Skill_GetAbnormalType(78708737)) >= 0 && myself.DistFromMe(myself.top_desire_target) > 40 )
- {
- if( myself.CanAttack(myself.top_desire_target) == 1 )
- {
- if( attacker.is_pc != 0 || myself.IsInCategory(12,attacker.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(12,attacker.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 && FloatToInt(myself.sm.hp) != FloatToInt(myself.sm.max_hp) )
- {
- myself.InstantTeleport(myself.sm,FloatToInt(attacker.x),FloatToInt(attacker.y),FloatToInt(attacker.z));
- }
- }
- if( attacker.is_pc != 0 || myself.IsInCategory(12,attacker.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 && FloatToInt(myself.sm.hp) != FloatToInt(myself.sm.max_hp) )
- {
- myself.InstantTeleport(myself.sm,FloatToInt(speller.x),FloatToInt(speller.y),FloatToInt(speller.z));
- }
- }
- EventHandler DESIRE_MANIPULATION(speller,desire)
- {
- myself.MakeAttackEvent(speller,desire,0);
- }
- EventHandler MY_DYING()
- {
- if( ShoutMsg4 > 0 && Rand(100) < 30 )
- {
- if( IsSay == 0 )
- {
- myself.Shout(MakeFString(ShoutMsg4,"","","","",""));
- }
- else
- {
- myself.Say(MakeFString(ShoutMsg4,"","","","",""));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement