Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Reflection;
- using DOL.Database;
- using DOL.Events;
- using DOL.GS;
- using DOL.GS.Scripts;
- using DOL.GS.Effects;
- using DOL.GS.PacketHandler;
- using DOL.GS.SkillHandler;
- using log4net;
- using DOL.AI;
- using DOL.AI.Brain;
- using DOL.GS.RealmAbilities;
- namespace DOL.GS
- {
- public class HealerMob : FaithMob
- {
- public HealerMob()
- : base()
- {
- SetOwnBrain(new HealerAI());
- }
- public override bool AddToWorld()
- {
- if (this.Name == "PoCAlbHeal")
- {
- int random = Util.Random(1, 8);
- switch (random) // 32;35;42;45;52;55;62;65
- {
- case 1:
- this.Model = 32;
- this.Name = "Accursed Marauder";
- break;
- case 2:
- this.Model = 35;
- this.Name = "Accursed Marauder";
- break;
- case 3:
- this.Model = 42;
- this.Name = "Accursed Marauder";
- break;
- case 4:
- this.Model = 45;
- this.Name = "Accursed Marauder";
- break;
- case 5:
- this.Model = 52;
- this.Name = "Accursed Marauder";
- break;
- case 6:
- this.Model = 55;
- this.Name = "Accursed Marauder";
- break;
- case 7:
- this.Model = 62;
- this.Name = "Accursed Marauder";
- break;
- case 8:
- this.Model = 65;
- this.Name = "Accursed Marauder";
- break;
- }
- int randlevel = Util.Random(1, 5);
- switch (randlevel) // 53;55;57;59;61
- {
- case 1:
- this.Level = 53;
- break;
- case 2:
- this.Level = 55;
- break;
- case 3:
- this.Level = 57;
- break;
- case 4:
- this.Level = 59;
- break;
- case 5:
- this.Level = 61;
- break;
- }
- }
- if (this.Name == "PoCMidHeal")
- {
- int random = Util.Random(1, 8);
- switch (random) // 153;163;143;145;165;175;172
- {
- case 1:
- this.Model = 153;
- this.Name = "Accursed Marauder";
- break;
- case 2:
- this.Model = 163;
- this.Name = "Accursed Marauder";
- break;
- case 3:
- this.Model = 143;
- this.Name = "Accursed Marauder";
- break;
- case 4:
- this.Model = 145;
- this.Name = "Accursed Marauder";
- break;
- case 5:
- this.Model = 165;
- this.Name = "Accursed Marauder";
- break;
- case 6:
- this.Model = 55;
- this.Name = "Accursed Marauder";
- break;
- case 7:
- this.Model = 175;
- this.Name = "Accursed Marauder";
- break;
- case 8:
- this.Model = 172;
- this.Name = "Accursed Marauder";
- break;
- }
- int randlevel = Util.Random(1, 5);
- switch (randlevel) // 53;55;57;59;61
- {
- case 1:
- this.Level = 53;
- break;
- case 2:
- this.Level = 55;
- break;
- case 3:
- this.Level = 57;
- break;
- case 4:
- this.Level = 59;
- break;
- case 5:
- this.Level = 61;
- break;
- }
- }
- if (this.Name == "PoCHibHeal")
- {
- int random = Util.Random(1, 7);
- switch (random) // 302;314;320;334;340;354;360
- {
- case 1:
- this.Model = 302;
- this.Name = "Accursed Marauder";
- break;
- case 2:
- this.Model = 314;
- this.Name = "Accursed Marauder";
- break;
- case 3:
- this.Model = 320;
- this.Name = "Accursed Marauder";
- break;
- case 4:
- this.Model = 334;
- this.Name = "Accursed Marauder";
- break;
- case 5:
- this.Model = 340;
- this.Name = "Accursed Marauder";
- break;
- case 6:
- this.Model = 354;
- this.Name = "Accursed Marauder";
- break;
- case 7:
- this.Model = 360;
- this.Name = "Accursed Marauder";
- break;
- }
- int randlevel = Util.Random(1, 5);
- switch (randlevel) // 53;55;57;59;61
- {
- case 1:
- this.Level = 53;
- break;
- case 2:
- this.Level = 55;
- break;
- case 3:
- this.Level = 57;
- break;
- case 4:
- this.Level = 59;
- break;
- case 5:
- this.Level = 61;
- break;
- }
- }
- return base.AddToWorld();
- }
- }
- }
- namespace DOL.AI.Brain
- {
- /// <summary>
- /// Healer Mob Brain
- /// </summary>
- public class HealerAI : FaithMobAI
- {
- public HealerAI()
- : base()
- {
- AggroLevel = 90;
- AggroRange = 1500;
- ThinkInterval = 2000;
- }
- /// <summary>
- /// Brain Think Method
- /// </summary>
- public override void Think()
- {
- if (this.Body.InCombat)
- {
- if (Util.Chance(10))
- {
- MasteryofConcentrationAbility moc = new MasteryofConcentrationAbility(SkillBase.GetDBAbility("Mastery of Concentration"), 3);
- moc.Execute(this.Body);
- }
- }
- if (!CheckAreaForAoEStun())
- {
- CheckAreaForHeals();
- }
- base.Think();
- }
- public bool CheckAreaForHeals()
- {
- if (Body == null || Body.IsCasting) return false;
- GameLiving target = null;
- foreach (GameNPC npc in Body.GetNPCsInRadius((ushort)this.AggroRange))
- {
- if (npc == null) continue;
- if (npc.HealthPercent < 100)
- {
- target = npc;
- break;
- }
- }
- if (target == null || HealSmallSpell == null) return false;
- Body.LastAttackTickPvE = Body.CurrentRegion.Time;
- target.LastAttackedByEnemyTickPvE = Body.CurrentRegion.Time;
- Body.StopAttack();
- Body.TargetObject = target;
- Body.CastSpell(HealSmallSpell, SkillBase.GetSpellLine(GlobalSpellsLines.Mob_Spells));
- return true;
- }
- public bool CheckAreaForAoEStun()
- {
- if (Body == null || Body.IsCasting) return false;
- GameLiving target = null;
- foreach (GamePlayer player in Body.GetPlayersInRadius((ushort)this.AggroRange))
- {
- if (player == null) continue;
- if (LivingHasEffect(player, StunSpell) == false)
- {
- if (GameServer.ServerRules.IsAllowedToAttack(this.Body, player, true))
- {
- target = player;
- break;
- }
- }
- }
- if (target == null || HealSmallSpell == null) return false;
- Body.LastAttackTickPvE = Body.CurrentRegion.Time;
- target.LastAttackedByEnemyTickPvE = Body.CurrentRegion.Time;
- Body.StopAttack();
- Body.TargetObject = target;
- Body.CastSpell(StunSpell, SkillBase.GetSpellLine(GlobalSpellsLines.Mob_Spells));
- return true;
- }
- private Spell m_HealSmallSpell;
- /// <summary>
- /// The heal spell
- /// </summary>
- public Spell HealSmallSpell
- {
- get
- {
- DBSpell spell = new DBSpell();
- spell.AllowAdd = false;
- spell.CastTime = 3;
- spell.ClientEffect = 1340;
- spell.Value = this.Body.Level * 10;
- spell.Name = "The Heal";
- spell.Range = 2000;
- spell.SpellID = 90004;
- spell.Target = "Realm";
- spell.Type = "Heal";
- //spell.Interruptable = 1;
- return new Spell(spell, 50);
- }
- }
- private Spell m_StunSpell;
- /// <summary>
- /// The stun spell
- /// </summary>
- public Spell StunSpell
- {
- get
- {
- DBSpell spell = new DBSpell();
- spell.AllowAdd = false;
- spell.CastTime = 2.5;
- spell.ClientEffect = 3379;
- spell.Icon = 3379;
- spell.Value = 0;
- spell.Duration = this.Body.Level / 5;
- spell.Name = "The Stun";
- spell.Range = 2000;
- spell.SpellID = 90006;
- spell.Target = "Enemy";
- spell.Type = "Stun";
- spell.Radius = 300;
- spell.EffectGroup = 20;
- //spell.Interruptable = 1;
- return new Spell(spell, 50);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment