示例#1
0
 public TBaseAI()
 {
     State             = AIState.AI_DO_NOTHING;
     aiTarget          = null;
     aiHateTable       = new Dictionary <WS_Base.BaseUnit, int>();
     aiHateTableRemove = new List <WS_Base.BaseUnit>();
 }
示例#2
0
 public PetObject(ulong GUID_, int CreatureID)
     : base(GUID_, CreatureID)
 {
     PetName     = "";
     Renamed     = false;
     Owner       = null;
     FollowOwner = true;
     Command     = 7;
     State       = 6;
     XP          = 0;
 }
示例#3
0
 public void CastAcid()
 {
     for (int i = 0; i <= 3; i++)
     {
         WS_Base.BaseUnit Target = aiCreature;
         if (Target is null)
         {
             return;
         }
         aiCreature.CastSpell(ACID_SPELL, aiTarget);
     }
 }
 public void CastBolt()
 {
     for (int i = 1; i <= 1; i++)
     {
         WS_Base.BaseUnit Target = aiCreature;
         if (Target is null)
         {
             return;
         }
         aiCreature.CastSpell(BOLT_SPELL, aiTarget);
     }
 }
 public void CastHeal()
 {
     for (int i = 0; i <= 1; i++)
     {
         WS_Base.BaseUnit Target = aiCreature;
         if (Target is null)
         {
             return;
         }
         aiCreature.CastSpell(HEAL_SPELL, aiTarget);
     }
 }
示例#6
0
 public void CastInfectedWound()
 {
     for (int i = 0; i <= 0; i++)
     {
         WS_Base.BaseUnit target = aiCreature;
         if (target is null)
         {
             return;
         }
         aiCreature.CastSpell(Spell_Infected_Wound, aiTarget);
     }
 }
示例#7
0
 public void CastKnockdown()      // This is where the spell is brought into actual usage.
 {
     for (int i = 0; i <= 3; i++) // I believe this number is capped by the amount of spells from 0-any number. We'll make it 0 to 3 here just to be safe. You should do the same.
     {
         WS_Base.BaseUnit Target = aiCreature;
         if (Target is null)
         {
             return;                                      // If no player is targetted, don't cast knockdown.
         }
         aiCreature.CastSpell(Spell_Knockdown, aiTarget); // The casting of the spell. This will be casted on the selected target as defined previously.
     }
 }
 public void CastLightning()
 {
     for (int i = 0; i <= 3; i++)
     {
         WS_Base.BaseUnit Target = aiCreature;
         if (Target is null)
         {
             return;
         }
         aiCreature.CastSpell(Spell_Lightning_Bolt, aiTarget);
     }
 }
示例#9
0
        public void CastInferno()
        {
            for (int i = 0; i <= 3; i++)
            {
                WS_Base.BaseUnit Target = aiTarget;
                if (Target is null)
                {
                    return;
                }

                aiCreature.CastSpell(Spell_Inferno, aiTarget); // This spell should be mitigated with fire resistance and nothing more.
            }
        }
示例#10
0
        public void CastLivingBomb()
        {
            for (int i = 2; i <= 3; i++)
            {
                WS_Base.BaseUnit target = aiCreature.GetRandomTarget();
                if (target is null)
                {
                    return;
                }

                aiCreature.CastSpell(Spell_Living_Bomb, aiCreature.GetRandomTarget()); // The traditional way of getting away of this is to run where the dead trash is from your group so they don't die, but we may need to fix AoE implementations for this.
            }
        }
示例#11
0
    public void CastUPPER()
    {
        for (var i = 1; i <= 1; i++)
        {
            WS_Base.BaseUnit Target = aiCreature;
            if (Target is null)
            {
                return;
            }

            aiCreature.CastSpell(UPPER_SPELL, aiTarget);
        }
    }
示例#12
0
        public void CastThunderClap()
        {
            for (int i = 2; i <= 3; i++)
            {
                WS_Base.BaseUnit target = aiCreature;
                if (target is null)
                {
                    return;
                }
            }

            aiCreature.CastSpell(Thunder_Clap_CD, aiTarget);
        }
示例#13
0
    public void CastSlumber()
    {
        for (var i = 1; i <= 3; i++)
        {
            WS_Base.BaseUnit target = aiCreature;
            if (target is null)
            {
                return;
            }
        }

        aiCreature.CastSpell(Slumber_Spell, aiTarget);
    }
示例#14
0
    public void CastPoison()
    {
        for (var i = 2; i <= 3; i++)
        {
            WS_Base.BaseUnit target = aiCreature;
            if (target is null)
            {
                return;
            }
        }

        aiCreature.CastSpell(Poison_Spell, aiTarget);
    }
示例#15
0
        public void CastIgnite()
        {
            for (int i = 1; i <= 3; i++)
            {
                WS_Base.BaseUnit target = aiCreature.GetRandomTarget();
                if (target is null)
                {
                    return;
                }

                aiCreature.CastSpell(Spell_Ignite, aiCreature.GetRandomTarget()); // This spell drains 400 mana per second and MUST be dispelled immediately or your healers will wipe the group.
            }
        }
示例#16
0
        public void CastSlumber()
        {
            for (int i = 1; i <= 3; i++)
            {
                WS_Base.BaseUnit target = aiCreature.GetRandomTarget();
                if (target is null)
                {
                    return;
                }
            }

            aiCreature.CastSpell(Slumber_Spell, aiCreature.GetRandomTarget());
        }
示例#17
0
 public TotemObject(int Entry, float PosX, float PosY, float PosZ, float Orientation, int Map, int Duration_ = 0)
     : base(Entry, PosX, PosY, PosZ, Orientation, Map, Duration_)
 {
     Caster   = null;
     Duration = 0;
     Type     = TotemType.TOTEM_PASSIVE;
     if (aiScript != null)
     {
         aiScript.Dispose();
     }
     aiScript = null;
     Duration = Duration_;
 }
示例#18
0
    public void CastCOA()
    {
        for (var i = 0; i <= 3; i++)
        {
            WS_Base.BaseUnit Target = aiCreature;
            if (Target is null)
            {
                return;
            }

            aiCreature.CastSpell(COA_SPELL, aiTarget);
        }
    }
    public void HealGluth(ref WS_Creatures.CreatureObject NPC_Gluth, ref WS_Creatures.CreatureObject Zombie_Chow)
    {
        coords Waypoint1 = new()
        {
            X           = 3304.919922d,
            Y           = 3139.149902d,
            Z           = 296.890015d,
            Orientation = 1.33d
        };

        aiCreature.MoveTo((float)Waypoint1.X, (float)Waypoint1.Y, (float)Waypoint1.Z, (float)Waypoint1.Orientation);
        if (Conversions.ToBoolean(aiCreature.MoveTo((float)Waypoint1.X, (float)Waypoint1.Y, (float)Waypoint1.Z, (float)Waypoint1.Orientation, true)))
        {
            WS_Base.BaseUnit argAttacker = null;
            aiCreature.Heal(50000, Attacker: argAttacker);
        }
    }
示例#20
0
            public bool Update()
            {
                if (Caster == null)
                {
                    return(true);
                }
                bool DeleteThis = false;

                checked
                {
                    if (Duration > 1000)
                    {
                        Duration -= 1000;
                    }
                    else
                    {
                        DeleteThis = true;
                    }
                }
                foreach (WS_Spells.SpellEffect effect in Effects)
                {
                    WS_Spells.SpellEffect Effect = effect;
                    if (Effect.GetRadius == 0f)
                    {
                        if (Effect.Amplitude == 0 || checked (WorldServiceLocator._WS_Spells.SPELLs[SpellID].GetDuration - Duration) % Effect.Amplitude == 0)
                        {
                            WS_Spells.ApplyAuraHandler obj        = WorldServiceLocator._WS_Spells.AURAs[Effect.ApplyAuraIndex];
                            ref WS_Base.BaseUnit       caster     = ref Caster;
                            WS_Base.BaseObject         baseObject = this;
                            obj(ref caster, ref baseObject, ref Effect, SpellID, 1, AuraAction.AURA_UPDATE);
                        }
                        continue;
                    }
                    List <WS_Base.BaseUnit> Targets = WorldServiceLocator._WS_Spells.GetEnemyAtPoint(ref Caster, positionX, positionY, positionZ, Effect.GetRadius);
                    foreach (WS_Base.BaseUnit item in Targets)
                    {
                        WS_Base.BaseUnit Target = item;
                        if (Effect.Amplitude == 0 || checked (WorldServiceLocator._WS_Spells.SPELLs[SpellID].GetDuration - Duration) % Effect.Amplitude == 0)
                        {
                            WS_Spells.ApplyAuraHandler obj2       = WorldServiceLocator._WS_Spells.AURAs[Effect.ApplyAuraIndex];
                            WS_Base.BaseObject         baseObject = this;
                            obj2(ref Target, ref baseObject, ref Effect, SpellID, 1, AuraAction.AURA_UPDATE);
                        }
                    }
                }
示例#21
0
 public void Cast_Lucirons_Curse()
 {
     for (int i = 0; i <= 2; i++)
     {
         WS_Base.BaseUnit theTarget = aiCreature;
         if (theTarget is null)
         {
             return;
         }
         try
         {
             aiCreature.CastSpell(Lucifrons_Curse, aiTarget);
         }
         catch (Exception)
         {
             aiCreature.SendChatMessage("Failed to cast Lucifron's Curse. This is bad. Please report to developers.", ChatMsg.CHAT_MSG_MONSTER_YELL, LANGUAGES.LANG_UNIVERSAL);
         }
     }
 }
示例#22
0
 public void CastDecimate()
 {
     for (int i = 0; i <= 3; i++)
     {
         WS_Base.BaseUnit Target = aiCreature;
         if (Target is null)
         {
             return;
         }
         try
         {
             aiCreature.CastSpell(Spell_Decimate, aiTarget);
         }
         catch (Exception)
         {
             aiCreature.SendChatMessage("I have failed to cast decimate. Whoever made this script is bad. Please report this to the developers.", ChatMsg.CHAT_MSG_YELL, LANGUAGES.LANG_GLOBAL);
         }
     }
 }
示例#23
0
 public void CastTerrifyingRoar()
 {
     for (int i = 3; i <= 3; i++)
     {
         WS_Base.BaseUnit target = aiCreature;
         if (target is null)
         {
             return;
         }
         try
         {
             aiCreature.CastSpell(Spell_Terrifying_Roar, aiTarget);
         }
         catch (Exception)
         {
             aiCreature.SendChatMessage("I have failed to cast terrifying roar. Whoever made this script did a poor job, please report this to the developers.", ChatMsg.CHAT_MSG_YELL, LANGUAGES.LANG_GLOBAL);
         }
     }
 }
示例#24
0
 public void CastFrenzy()
 {
     for (int i = 1; i <= 3; i++)
     {
         WS_Base.BaseUnit Target = aiCreature;
         if (Target is null)
         {
             return;
         }
         try
         {
             aiCreature.CastSpellOnSelf(Spell_Frenzy);
         }
         catch (Exception)
         {
             aiCreature.SendChatMessage("I have failed to cast Frenzy. Whoever made this script did a poor job, please report this to the developers.", ChatMsg.CHAT_MSG_YELL, LANGUAGES.LANG_GLOBAL);
         }
     }
 }
示例#25
0
 public void Cast_Impending_Doom()
 {
     for (int i = 1; i <= 2; i++)
     {
         WS_Base.BaseUnit theTarget = aiCreature;
         if (theTarget is null)
         {
             return;
         }
         try
         {
             aiCreature.CastSpell(Impending_Doom, aiTarget);
         }
         catch (Exception)
         {
             aiCreature.SendChatMessage("Failed to cast IMPENDING DOOOOOM! Please report this to a developer.", ChatMsg.CHAT_MSG_MONSTER_YELL, LANGUAGES.LANG_UNIVERSAL);
         }
     }
 }
示例#26
0
 public void CastThrash()
 {
     for (int i = 0; i <= 0; i++)
     {
         WS_Base.BaseUnit Target = aiCreature;
         if (Target is null)
         {
             return;
         }
         try
         {
             aiCreature.CastSpellOnSelf(Spell_Thrash);
         }
         catch (Exception)
         {
             aiCreature.SendChatMessage("AI was unable to cast Thrash on himself. Please report this to a developer.", ChatMsg.CHAT_MSG_YELL, LANGUAGES.LANG_GLOBAL);
         }
     }
 }
 public void CastPyroBlast()
 {
     for (int i = 2; i <= 2; i++)
     {
         WS_Base.BaseUnit Target = aiCreature;
         if (Target is null)
         {
             return;
         }
         try
         {
             aiCreature.CastSpell(PYROBLAST_SPELL, aiTarget);
         }
         catch (Exception)
         {
             aiCreature.SendChatMessage("PYROBLAST FAILED TO CAST ON TARGET! Please report this to the DEV'S!", ChatMsg.CHAT_MSG_MONSTER_YELL, LANGUAGES.LANG_UNIVERSAL);
         }
     }
 }
 public void CastEarthQuake()
 {
     for (int i = 0; i <= 2; i++)
     {
         WS_Base.BaseUnit Target = aiCreature;
         if (Target is null)
         {
             return;
         }
         try
         {
             aiCreature.CastSpell(EARTHQUAKE_SPELL, aiTarget);
         }
         catch (Exception)
         {
             aiCreature.SendChatMessage("Earthquake FAILED TO CAST ON MY TARGET! Please report this to the DEV'S!", ChatMsg.CHAT_MSG_MONSTER_YELL, LANGUAGES.LANG_UNIVERSAL);
         }
     }
 }
示例#29
0
        public void Cast_Shadow_Shock()
        {
            for (int i = 2; i <= 2; i++)
            {
                WS_Base.BaseUnit theTarget = aiCreature.GetRandomTarget();
                if (theTarget is null)
                {
                    return;
                }

                try
                {
                    aiCreature.CastSpell(Shadow_Shock, theTarget.positionX, theTarget.positionY, theTarget.positionZ);
                }
                catch (Exception)
                {
                    aiCreature.SendChatMessage("Failed to cast Shadow Shock. Please report this to a developer.", ChatMsg.CHAT_MSG_MONSTER_YELL, LANGUAGES.LANG_UNIVERSAL);
                }
            }
        }
    public void CastMagmaSplash()
    {
        for (var i = 1; i <= 2; i++)
        {
            WS_Base.BaseUnit Target = aiCreature;
            if (Target is null)
            {
                return;
            }

            try
            {
                aiCreature.CastSpell(MAGMASPLASH_SPELL, aiTarget);
            }
            catch (Exception)
            {
                aiCreature.SendChatMessage("MAGMASPLASH FAILED TO CAST ON TARGET! Please report this to the DEV'S!", ChatMsg.CHAT_MSG_MONSTER_YELL, LANGUAGES.LANG_UNIVERSAL);
            }
        }
    }