Example #1
0
        public override void ChangeState()
        {
            uint field = 0;

            switch (OldState)
            {
            case ObjectiveStates.Neutral:
                field = HPConst.Map_N[m_TowerType];
                break;

            case ObjectiveStates.Alliance:
                field = HPConst.Map_A[m_TowerType];
                uint alliance_towers = ((HellfirePeninsulaPvP)PvP).GetAllianceTowersControlled();
                if (alliance_towers != 0)
                {
                    ((HellfirePeninsulaPvP)PvP).SetAllianceTowersControlled(--alliance_towers);
                }
                break;

            case ObjectiveStates.Horde:
                field = HPConst.Map_H[m_TowerType];
                uint horde_towers = ((HellfirePeninsulaPvP)PvP).GetHordeTowersControlled();
                if (horde_towers != 0)
                {
                    ((HellfirePeninsulaPvP)PvP).SetHordeTowersControlled(--horde_towers);
                }
                break;

            case ObjectiveStates.NeutralAllianceChallenge:
                field = HPConst.Map_N[m_TowerType];
                break;

            case ObjectiveStates.NeutralHordeChallenge:
                field = HPConst.Map_N[m_TowerType];
                break;

            case ObjectiveStates.AllianceHordeChallenge:
                field = HPConst.Map_A[m_TowerType];
                break;

            case ObjectiveStates.HordeAllianceChallenge:
                field = HPConst.Map_H[m_TowerType];
                break;
            }

            // send world state update
            if (field != 0)
            {
                PvP.SendUpdateWorldState(field, 0);
                field = 0;
            }
            uint artkit  = 21;
            uint artkit2 = HPConst.TowerArtKit_N[m_TowerType];

            switch (State)
            {
            case ObjectiveStates.Neutral:
                field = HPConst.Map_N[m_TowerType];
                break;

            case ObjectiveStates.Alliance:
            {
                field   = HPConst.Map_A[m_TowerType];
                artkit  = 2;
                artkit2 = HPConst.TowerArtKit_A[m_TowerType];
                uint alliance_towers = ((HellfirePeninsulaPvP)PvP).GetAllianceTowersControlled();
                if (alliance_towers < 3)
                {
                    ((HellfirePeninsulaPvP)PvP).SetAllianceTowersControlled(++alliance_towers);
                }
                PvP.SendDefenseMessage(HPConst.BuffZones[0], HPConst.LangCapture_A[m_TowerType]);
                break;
            }

            case ObjectiveStates.Horde:
            {
                field   = HPConst.Map_H[m_TowerType];
                artkit  = 1;
                artkit2 = HPConst.TowerArtKit_H[m_TowerType];
                uint horde_towers = ((HellfirePeninsulaPvP)PvP).GetHordeTowersControlled();
                if (horde_towers < 3)
                {
                    ((HellfirePeninsulaPvP)PvP).SetHordeTowersControlled(++horde_towers);
                }
                PvP.SendDefenseMessage(HPConst.BuffZones[0], HPConst.LangCapture_H[m_TowerType]);
                break;
            }

            case ObjectiveStates.NeutralAllianceChallenge:
                field = HPConst.Map_N[m_TowerType];
                break;

            case ObjectiveStates.NeutralHordeChallenge:
                field = HPConst.Map_N[m_TowerType];
                break;

            case ObjectiveStates.AllianceHordeChallenge:
                field   = HPConst.Map_A[m_TowerType];
                artkit  = 2;
                artkit2 = HPConst.TowerArtKit_A[m_TowerType];
                break;

            case ObjectiveStates.HordeAllianceChallenge:
                field   = HPConst.Map_H[m_TowerType];
                artkit  = 1;
                artkit2 = HPConst.TowerArtKit_H[m_TowerType];
                break;
            }

            Map map    = Global.MapMgr.FindMap(530, 0);
            var bounds = map.GetGameObjectBySpawnIdStore().LookupByKey(m_capturePointSpawnId);

            foreach (var go in bounds)
            {
                go.SetGoArtKit((byte)artkit);
            }

            bounds = map.GetGameObjectBySpawnIdStore().LookupByKey(m_Objects[m_TowerType]);
            foreach (var go in bounds)
            {
                go.SetGoArtKit((byte)artkit2);
            }

            // send world state update
            if (field != 0)
            {
                PvP.SendUpdateWorldState(field, 1);
            }

            // complete quest objective
            if (State == ObjectiveStates.Alliance || State == ObjectiveStates.Horde)
            {
                SendObjectiveComplete(HPConst.CreditMarker[m_TowerType], ObjectGuid.Empty);
            }
        }
Example #2
0
        public async override Task <bool> Combat()
        {
            if (Settings.AutoTarget)
            {
                AutoTarget();
            }

            if (Settings.EnableMovement || Settings.EnableFacing)
            {
                await MoveToTarget();
            }

            Globals.UpdateCombat();

            if (!StyxWoW.Me.GotTarget)
            {
                return(false);
            }

            if (await MySpells.HotkeysMethod())
            {
                return(true);
            }

            if (await MySpells.RacialsMethod())
            {
                return(true);
            }

            if (await MySpells.TotemStompMethod())
            {
                return(true);
            }

            if (Globals.Pvp && PvP.PvPCheck())
            {
                return(true);
            }

            if (await MySpells.RebukeMethod())
            {
                return(true);
            }

            if (SpellManager.GlobalCooldownLeft.TotalMilliseconds > 200)
            {
                return(true);
            }

            if (await MySpells.HammerOfJusticeMethod())
            {
                return(true);
            }
            if (await MySpells.BlindingLightMethod())
            {
                return(true);
            }
            if (await MySpells.RepentanceMethod())
            {
                return(true);
            }

            if (await MySpells.HolyWrathMethod())
            {
                return(true);
            }

            if (await MySpells.WakeOfAshesMethod())
            {
                return(true);
            }

            if (await MySpells.HammerOfReckoningMethod())
            {
                return(true);
            }

            if (await MySpells.ExecutionSentenceMethod())
            {
                return(true);
            }

            if (await MySpells.JusticarsVengeanceMethod())
            {
                return(true);
            }

            if (await MySpells.HandOfHindranceMethod())
            {
                return(true);
            }

            if (await MySpells.DivineStormMethod())
            {
                return(true);
            }

            if (await MySpells.TemplarsVerdictMethod())
            {
                return(true);
            }

            if (await MySpells.ConsecrationMethod())
            {
                return(true);
            }

            if (await MySpells.BladeOfWrathMethod())
            {
                return(true);
            }

            if (await MySpells.JudgmentMethod())
            {
                return(true);
            }
            if (await MySpells.DivineHammerMethod())
            {
                return(true);
            }
            if (await MySpells.CrusaderStrikeMethod())
            {
                return(true);
            }

            return(false);
        }
Example #3
0
 public void AddPvP(PvP newPvP)
 {
     pvp.Add(newPvP);
     newPvP.ID = pvp.Max(p => p.ID) + 1;
 }
Example #4
0
        public async override Task <bool> Combat()
        {
            if (Settings.AutoTarget)
            {
                AutoTarget();
            }

            if (Settings.EnableMovement || Settings.EnableFacing)
            {
                await MoveToTarget();
            }

            Globals.UpdateCombatProt();

            if (!StyxWoW.Me.GotTarget)
            {
                return(false);
            }

            if (await MySpells.HotkeysMethod())
            {
                return(true);
            }

            if (await MySpells.RacialsMethod())
            {
                return(true);
            }

            if (await MySpells.TotemStompMethod())
            {
                return(true);
            }

            if (Globals.Pvp && PvP.PvPCheck())
            {
                return(true);
            }

            if (await MySpells.RacialsMethod())
            {
                return(true);
            }

            if (await MySpells.TotemStompMethod())
            {
                return(true);
            }

            // if (await MySpells.ShieldOfVirtue()) return true; // Honor Talent silence
            if (await MySpells.RebukeMethod())
            {
                return(true);
            }

            if (await MySpells.HammerOfJusticeMethod())
            {
                return(true);
            }
            if (await MySpells.BlindingLightMethod())
            {
                return(true);
            }

            if (await MySpells.EyeOfTyrMethod())
            {
                return(true);
            }

            if (await MySpells.AvengersShieldMethod())
            {
                return(true);
            }
            if (await MySpells.JudgmentMethod())
            {
                return(true);
            }
            if (await MySpells.ConsecrationMethod())
            {
                return(true);
            }
            if (await MySpells.ShieldOfRighteousMethod())
            {
                return(true);
            }
            if (await MySpells.BlessedHammerMethod())
            {
                return(true);
            }
            if (await MySpells.HammerOfRighteousMethod())
            {
                return(true);
            }

            return(false);
        }