Пример #1
0
        public static void ChangeAttackBuff(ICharacter character, ICharacter attacker, IMap map, int counter, PacketHitList hitlist)
        {
            if (counter < 0) {
                if (character.VolatileStatus.GetStatus("Mist") != null) {
                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s stats didn't drop due to the mist!", Text.WhiteSmoke), character.X, character.Y, 10);
                    return;
                }
                if (attacker != character && character.VolatileStatus.GetStatus("Substitute") != null) {
                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by Substitute!", Text.WhiteSmoke), character.X, character.Y, 10);
                    return;
                }

                //twist band
                if (character.HasActiveItem(172)) {
                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Twist Band prevented its Attack stats from dropping!", Text.WhiteSmoke), character.X, character.Y, 10);
                    return;
                }

                if (HasActiveBagItem(character, 49, 0, 0)) {
                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s item prevented its stats from dropping!", Text.WhiteSmoke), character.X, character.Y, 10);
                    return;
                }

                if (HasAbility(character, "White Smoke") && !HasAbility(attacker, "Mold Breaker")) {
                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s White Smoke prevented its stats from dropping!", Text.WhiteSmoke), character.X, character.Y, 10);
                    return;
                }

                if (HasAbility(character, "Clear Body") && !HasAbility(attacker, "Mold Breaker")) {
                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Clear Body prevented its stats from dropping!", Text.WhiteSmoke), character.X, character.Y, 10);
                    return;
                }

                if (HasAbility(character, "Hyper Cutter") && !HasAbility(attacker, "Mold Breaker")) {
                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Hyper Cutter prevented its Attack from dropping!", Text.WhiteSmoke), character.X, character.Y, 10);
                    return;
                }
            }

            if (HasAbility(character, "Contrary") && !HasAbility(attacker, "Mold Breaker")) {
                counter *= -1;
            }

            if (HasAbility(character, "Simple") && !HasAbility(attacker, "Mold Breaker")) {
                counter *= 2;
            }

            if (character.AttackBuff >= 10 && counter > 0) {
                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Attack won't go higher!", Text.WhiteSmoke), character.X, character.Y, 10);
                return;
            } else if (character.AttackBuff <= -10 && counter < 0) {
                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Attack won't go lower!", Text.WhiteSmoke), character.X, character.Y, 10);
                return;
            }

            if (character.AttackBuff + counter > 10) {
                counter = 10 - character.AttackBuff;
            } else if (character.AttackBuff + counter < -10) {
                counter = -10 - character.AttackBuff;
            }

            if (counter == 0) {
                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Attack didn't change.", Text.WhiteSmoke), character.X, character.Y, 10);
            } else if (counter == 1) {
                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Attack rose slightly.", Text.WhiteSmoke), character.X, character.Y, 10);
            } else if (counter == -1) {
                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Attack fell slightly.", Text.WhiteSmoke), character.X, character.Y, 10);
            } else if (counter == 2) {
                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Attack rose sharply!", Text.WhiteSmoke), character.X, character.Y, 10);
            } else if (counter == -2) {
                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Attack fell harshly!", Text.WhiteSmoke), character.X, character.Y, 10);
            } else if (counter > 2) {
                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Attack rose drastically!", Text.WhiteSmoke), character.X, character.Y, 10);
            } else if (counter < -2) {
                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Attack fell drastically!", Text.WhiteSmoke), character.X, character.Y, 10);
            }
            character.AttackBuff += counter;

            if (counter < 0 && HasAbility(character, "Defiant")) {
                //hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " defied the stat change!", Text.WhiteSmoke), character.X, character.Y, 10);
                ChangeAttackBuff(character, map, 2, hitlist);
            }
            if (counter < 0 && HasAbility(character, "Competitive")) {
                //hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " defied the stat change!", Text.WhiteSmoke), character.X, character.Y, 10);
                ChangeSpAtkBuff(character, map, 2, hitlist);
            }
        }
Пример #2
0
        public static Enums.Weather GetCharacterWeather(ICharacter character)
        {
            try {
            if (character.HasActiveItem(303)) {
                return Enums.Weather.None;
            }
            IMap map = MapManager.RetrieveActiveMap(character.MapID);
            if (map != null) {
                if (map.Weather == Enums.Weather.Ambiguous || map.Weather == Enums.Weather.None) {
                    if (character.HasActiveItem(302)) {
                        return Enums.Weather.Sunny;
                    } else if (character.HasActiveItem(301)) {
                        return Enums.Weather.Raining;
                    } else if (character.HasActiveItem(300)) {
                        return Enums.Weather.Sandstorm;
                    } else if (character.HasActiveItem(299)) {
                        return Enums.Weather.Hail;
                    }

                }

                return map.Weather;
            }
            } catch (Exception ex) {
                Messenger.AdminMsg("Error: GetCharacterWeather", Text.Black);
            }

            return Enums.Weather.Ambiguous;
        }
Пример #3
0
        public static void RefreshCharacterSprite(ICharacter character, IMap map, PacketHitList hitlist)
        {
            PacketHitList.MethodStart(ref hitlist);
            //sprite
            ExtraStatus status;

            int sprite = character.Sprite;

            character.CalculateOriginalSprite();

            if (character.HasActiveItem(259) && character.HeldItem.Num == 259 && map != null && map.Moral == Enums.MapMoral.House) {
                character.Sprite = character.HeldItem.Tag.ToInt();
            }

            status = character.VolatileStatus.GetStatus("Illusion");
            if (status != null) {
                character.Sprite = status.Counter;
            }

            if (character.VolatileStatus.GetStatus("Substitute") != null) {
                character.Sprite = 0;
                character.Form = 3;
            }

            if (character.VolatileStatus.GetStatus("SemiInvul") != null ||
                character.VolatileStatus.GetStatus("SkyDrop:0") != null ||
                character.VolatileStatus.GetStatus("SkyDrop:1") != null) {
                character.Sprite = 0;
                character.Form = 2;
            }
            if (sprite != character.Sprite) {
                if (character.CharacterType == Enums.CharacterType.Recruit) {
                    PacketBuilder.AppendSprite(((Recruit)character).Owner, hitlist);
                } else {

                    PacketBuilder.AppendNpcSprite(map, hitlist, ((MapNpc)character).MapSlot);
                }
            }
            PacketHitList.MethodEnded(ref hitlist);
        }
Пример #4
0
        public static void AddExtraStatus(ICharacter character, ICharacter attacker, IMap map, string name, int counter, ICharacter target, string tag, PacketHitList hitlist, bool msg)
        {
            PacketHitList.MethodStart(ref hitlist);

            if (CheckStatusProtection(character, attacker, map, name + ":" + counter, tag, true, hitlist)) {
                PacketHitList.MethodEnded(ref hitlist);
                return;
            }

            if (name == "MovementSpeed" && character.VolatileStatus.GetStatus(name) != null ||
                name == "TypeReduce" && character.VolatileStatus.GetStatus(name) != null ||
                name == "TypeBoost" && character.VolatileStatus.GetStatus(name) != null ||
                name == "AttackReturn" && character.VolatileStatus.GetStatus(name) != null ||
                name == "Type1" && character.VolatileStatus.GetStatus(name) != null ||
                name == "Type2" && character.VolatileStatus.GetStatus(name) != null ||
                name == "LastUsedMoveSlot" && character.VolatileStatus.GetStatus(name) != null ||
                name == "TimesLastMoveUsed" && character.VolatileStatus.GetStatus(name) != null ||
                name == "Stockpile" && character.VolatileStatus.GetStatus(name) != null ||
                name == "LastHitBy" && character.VolatileStatus.GetStatus(name) != null ||
                name == "LastMoveHitBy" && character.VolatileStatus.GetStatus(name) != null ||
                name == "PerishCount" && character.VolatileStatus.GetStatus(name) != null ||
                name == "Curse" && character.VolatileStatus.GetStatus(name) != null ||
                name == "Charge" && character.VolatileStatus.GetStatus(name) != null ||
                name == "SureShot" && character.VolatileStatus.GetStatus(name) != null ||
                name == "Follow" && character.VolatileStatus.GetStatus(name) != null ||
                name == "Ability1" && character.VolatileStatus.GetStatus(name) != null ||
                name == "Ability2" && character.VolatileStatus.GetStatus(name) != null ||
                name == "Ability3" && character.VolatileStatus.GetStatus(name) != null ||
                name == "ProxyAttack" && character.VolatileStatus.GetStatus(name) != null ||
                name == "ProxyDefense" && character.VolatileStatus.GetStatus(name) != null ||
                name == "ProxySpAttack" && character.VolatileStatus.GetStatus(name) != null ||
                name == "ProxySpDefense" && character.VolatileStatus.GetStatus(name) != null) {
                RemoveExtraStatus(character, map, name, hitlist, false);
            }

            if (name == "TypeReduce" && character.VolatileStatus.GetStatus(name) != null ||
                name == "TypeBoost" && character.VolatileStatus.GetStatus(name) != null ||
                name == "AttackReturn" && character.VolatileStatus.GetStatus(name) != null ||
                name == "Status Guard" && character.VolatileStatus.GetStatus(name) != null) {
                RemoveExtraStatus(character, map, name, hitlist, true);
            }

            if (name == "LeechSeed" && character.VolatileStatus.GetStatus(name) != null && counter == 1) {
                RemoveBondedExtraStatus(character, map, "LeechSeed:1", hitlist, msg);
            }

            if (character.VolatileStatus.GetStatus(name) == null) {
                ExtraStatus newStatus = new ExtraStatus();
                newStatus.Name = name;
                newStatus.Emoticon = -1;
                newStatus.Counter = counter;
                newStatus.Target = target;
                newStatus.Tag = tag;
                character.VolatileStatus.Add(newStatus);
                string[] nameSegment = name.Split(':');

                //announce to map

                switch (nameSegment[0]) {

                    case "Confusion": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " became confused!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 4;
                            RefreshCharacterConfusion(character, map, hitlist);
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Safeguard": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected with a veil!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 137;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Status Guard": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected from " + (Enums.StatusAilment)(tag.ToInt()) + "!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 39;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Confusion Guard": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected from confusion!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 39;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Mist": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is shrouded in mist!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 179;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "LuckyChant": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Lucky Chant blocked it from critical hits!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 193;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Reflect": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Reflect slightly raised its Defense!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 25;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "LightScreen": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Light Screen slightly raised its Special Defense!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 67;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Slip": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can now travel on water!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterMobility(character, map, hitlist);
                        }
                        break;
                    case "SuperMobile": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can now travel on any terrain!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterMobility(character, map, hitlist);
                        }
                        break;
                    case "MovementSpeed": {
                            RefreshCharacterSpeedLimit(character, map, hitlist);
                            ExtraStatus addedStatus = character.VolatileStatus.GetStatus("MovementSpeed");
                            if (addedStatus.Counter > 2) addedStatus.Counter = 2;
                            if (addedStatus.Counter < -3) addedStatus.Counter = -3;

                            switch (GetSpeedLimit(character)) {
                                case Enums.Speed.SuperSlow: {
                                        if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is at quarter speed!", Text.WhiteSmoke), character.X, character.Y, 10);
                                    }
                                    break;
                                case Enums.Speed.Slow: {
                                        if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is at half speed!", Text.WhiteSmoke), character.X, character.Y, 10);
                                    }
                                    break;
                                case Enums.Speed.Walking: {
                                        if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was slowed!", Text.WhiteSmoke), character.X, character.Y, 10);
                                    }
                                    break;
                                case Enums.Speed.Running: {
                                        if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is at normal speed!", Text.WhiteSmoke), character.X, character.Y, 10);
                                        RemoveExtraStatus(character, map, name, hitlist, false);
                                    }
                                    break;
                                case Enums.Speed.Fast: {
                                        if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is at double speed!", Text.WhiteSmoke), character.X, character.Y, 10);
                                    }
                                    break;
                                case Enums.Speed.SuperFast: {
                                        if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is at quadruple speed!", Text.WhiteSmoke), character.X, character.Y, 10);
                                    }
                                    break;
                            }
                        }
                        break;
                    case "AquaRing": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is surrounded by a veil of water!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 22;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Wish": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg("A wish was made for " + character.Name + "!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 187;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Substitute": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " created a substitute!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterSprite(character, map, hitlist);
                        }
                        break;
                    case "Blind": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " became blinded!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterDarkness(character, map, hitlist);
                            newStatus.Emoticon = 17;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Nausea": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " became nauseated!  It can't eat anything!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 36;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Shocker": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " became shocked!  It can't tell friend from foe!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterDarkness(character, map, hitlist);
                            newStatus.Emoticon = 64;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Immobilize": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " became immobilized!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterSpeedLimit(character, map, hitlist);
                            RefreshCharacterSwapLock(character, map, hitlist);
                        }
                        break;
                    case "GastroAcid": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s abilities were nullified!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 63;
                            RefreshCharacterTraits(character, map, hitlist, false, false, false, true, false, false, false, false, false, false, false, false, true);
                        }
                        break;
                    case "Ability1": {
                            if (tag != "None") {
                                if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " acquired the ability " + tag + "!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            if (tag == "Insomnia") {
                                if (character.StatusAilment == Enums.StatusAilment.Sleep) {
                                    SetStatusAilment(character, map, Enums.StatusAilment.OK, 0, hitlist);
                                }
                                RemoveExtraStatus(character, map, "Yawn", hitlist);
                            }
                            RefreshCharacterTraits(character, map, hitlist, false, false, false, true, false, false, false, false, false, false, false, false, false);
                        }
                        break;
                    case "Ability2": {
                            if (tag != "None") {
                                if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " acquired the ability " + tag + "!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            if (tag == "Insomnia") {
                                if (character.StatusAilment == Enums.StatusAilment.Sleep) {
                                    SetStatusAilment(character, map, Enums.StatusAilment.OK, 0, hitlist);
                                }
                                RemoveExtraStatus(character, map, "Yawn", hitlist);
                            }
                            RefreshCharacterTraits(character, map, hitlist, false, false, false, true, false, false, false, false, false, false, false, false, false);
                        }
                        break;
                    case "Ability3": {
                            if (tag != "None") {
                                if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " acquired the ability " + tag + "!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            if (tag == "Insomnia") {
                                if (character.StatusAilment == Enums.StatusAilment.Sleep) {
                                    SetStatusAilment(character, map, Enums.StatusAilment.OK, 0, hitlist);
                                }
                                RemoveExtraStatus(character, map, "Yawn", hitlist);
                            }
                            RefreshCharacterTraits(character, map, hitlist, false, false, false, true, false, false, false, false, false, false, false, false, false);
                        }
                        break;
                    case "Nightmare": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " will get nightmares when it sleeps!", Text.BrightRed), character.X, character.Y, 10);
                            newStatus.Emoticon = 85;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Attract": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " became infatuated!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterSpeedLimit(character, map, hitlist);
                            if (character.HasActiveItem(704)) {
                                if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " has a Destiny Knot!", Text.WhiteSmoke), character.X, character.Y, 10);
                                TargetCollection targets = MoveProcessor.GetTargetsInRange(Enums.MoveRange.Room, 10, map, character, character.X, character.Y, Enums.Direction.Up, true, false, false);
                                for (int i = 0; i < targets.Count; i++) {
                                    AddExtraStatus(targets[i], null, map, "Attract", counter, null, "", hitlist, true);
                                }
                            }
                        }
                        break;
                    case "Follow": {
                            if (target != null) {
                                if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can only attack " + target.Name + " now!", Text.WhiteSmoke), character.X, character.Y, 10);
                            } else {
                                if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "is focused on a single target now!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            newStatus.Emoticon = 75;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Embargo": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was prevented from using items!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 147;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "HealBlock": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was prevented from recovering HP!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 91;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Ingrain": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " planted its roots!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterSpeedLimit(character, map, hitlist);
                            RefreshCharacterSwapLock(character, map, hitlist);
                        }
                        break;
                    case "Bind":
                    case "Clamp":
                    case "Wrap": {
                            if (nameSegment[1] == "0") {
                                if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was trapped by the foe!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            RefreshCharacterSpeedLimit(character, map, hitlist);
                            RefreshCharacterSwapLock(character, map, hitlist);
                        }
                        break;
                    case "FireSpin":
                    case "Whirlpool":
                    case "SandTomb":
                    case "Infestation": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was trapped in the swarm!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterSpeedLimit(character, map, hitlist);
                            RefreshCharacterSwapLock(character, map, hitlist);
                        }
                        break;
                    case "MagmaStorm": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was trapped in the vortex!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterSpeedLimit(character, map, hitlist);
                            RefreshCharacterSwapLock(character, map, hitlist);
                        }
                        break;
                    case "LeechSeed": {
                            if (nameSegment[1] == "0") {
                                if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " took on a Leech Seed!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                        }
                        break;
                    case "Taunt": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " fell for the taunt!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 23;
                            RefreshCharacterMoves(character, map, hitlist);
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Snatch": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is ready to snatch moves away!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 48;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Rage": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " became enraged!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 136;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "FocusEnergy": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is getting pumped!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 94;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Exposed": {
                            if (msg && !HasActiveBagItem(character, 20, 9, 0) && !HasActiveBagItem(character, 20, 6, 0)) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " became exposed to Normal- and Fighting- type attacks!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 16;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "MiracleEye": {
                            if (msg && !HasActiveBagItem(character, 20, 2, 0)) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can now hit Dark- types with Psychic- type moves!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 116;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Torment": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was subjected to Torment!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 149;
                            RefreshCharacterMoves(character, map, hitlist);
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Encore": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " received an encore!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 75;
                            RefreshCharacterMoves(character, map, hitlist);
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "TypeReduce": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " will take less damage from " + ((Enums.PokemonType)counter).ToString() + "-type attacks!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 96;
                        RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Type1": {
                            if (counter > 0) {
                                if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s type changed to " + ((Enums.PokemonType)counter).ToString() + "!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            RefreshCharacterTraits(character, map, hitlist, false, false, true, false, false, false, false, false, false, false, false, false, false);
                        }
                        break;
                    case "Type2": {
                            if (counter > 0) {
                                if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s second type changed to " + ((Enums.PokemonType)counter).ToString() + "!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            RefreshCharacterTraits(character, map, hitlist, false, false, true, false, false, false, false, false, false, false, false, false, false);
                        }
                        break;
                    case "TypeBoost": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s " + ((Enums.PokemonType)counter).ToString() + "-type attacks were boosted!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 111;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "AttackReturn": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is set to counter " + ((Enums.MoveCategory)counter).ToString() + " attacks!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 117;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Pierce": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " acquired a Pierce status!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 192;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Longtoss": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s range increased for single-target attacks!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 186;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "FlashFire": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Flash Fire increased the power of its Fire-type moves!", Text.WhiteSmoke), character.X, character.Y, 10);
                        }
                        break;
                    case "MoveSeal": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s " + MoveManager.Moves[character.Moves[nameSegment[1].ToInt()].MoveNum].Name + " was sealed!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterMoves(character, map, hitlist);
                        }
                        break;
                    case "Disable": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s " + MoveManager.Moves[character.Moves[counter].MoveNum].Name + " was disabled!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 161;
                            RefreshCharacterMoves(character, map, hitlist);
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "SolarBeam": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " took in sunlight!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterSpeedLimit(character, map, hitlist);
                            RefreshCharacterSwapLock(character, map, hitlist);
                        }
                        break;
                    case "SkullBash": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " lowered its head!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterSwapLock(character, map, hitlist);
                        }
                        break;
                    case "RazorWind": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " whipped up a whirlwind!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterSpeedLimit(character, map, hitlist);
                            RefreshCharacterSwapLock(character, map, hitlist);
                        }
                        break;
                    case "SkyAttack": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " became cloaked in a harsh light!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterSwapLock(character, map, hitlist);
                        }
                        break;
                    case "FocusPunch": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is tightening its focus!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterSpeedLimit(character, map, hitlist);
                            RefreshCharacterSwapLock(character, map, hitlist);
                        }
                        break;
                    case "SuperCharge": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is charged with power!", Text.WhiteSmoke), character.X, character.Y, 10);
                        }
                        break;
                    case "Charge": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is charging electrical power!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 69;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "SureShot": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " took aim!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 122;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Bide": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " began storing energy!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterSpeedLimit(character, map, hitlist);
                            RefreshCharacterSwapLock(character, map, hitlist);
                        }
                        break;
                    case "Avalanche": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " readied an avalanche!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterSpeedLimit(character, map, hitlist);
                            RefreshCharacterSwapLock(character, map, hitlist);
                        }
                        break;
                    case "VitalThrow": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " readied Vital Throw!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterSpeedLimit(character, map, hitlist);
                            RefreshCharacterSwapLock(character, map, hitlist);
                        }
                        break;
                    case "Stockpile": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " stockpiled " + counter + "!", Text.WhiteSmoke), character.X, character.Y, 10);
                        }
                        break;
                    case "Roost": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " landed on the ground!", Text.WhiteSmoke), character.X, character.Y, 10);
                        }
                        break;
                    case "SkyDrop": {
                        RemoveExtraStatus(character, map, "Grounded", hitlist, false);
                        RefreshCharacterSprite(character, map, hitlist);
                            if (msg && nameSegment[1] == "0") {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was taken into the sky!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            RefreshCharacterSpeedLimit(character, map, hitlist);
                            RefreshCharacterSwapLock(character, map, hitlist);
                        }
                        break;
                    case "SemiInvul": {
                        RefreshCharacterSprite(character, map, hitlist);
                        switch (tag) {
                                case "Dig": {
                                        if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " burrowed its way underground!", Text.WhiteSmoke), character.X, character.Y, 10);
                                    }
                                    break;
                                case "Bounce": {
                                        RemoveExtraStatus(character, map, "Grounded", hitlist, false);
                                        if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " sprang up!", Text.WhiteSmoke), character.X, character.Y, 10);
                                    }
                                    break;
                                case "Fly": {
                                        RemoveExtraStatus(character, map, "Grounded", hitlist, false);
                                        if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " flew up high!", Text.WhiteSmoke), character.X, character.Y, 10);
                                    }
                                    break;
                                case "ShadowForce": {
                                        if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " vanished instantly!", Text.WhiteSmoke), character.X, character.Y, 10);
                                        RefreshCharacterSprite(character, map, hitlist);
                                    }
                                    break;
                                case "Dive": {
                                        if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " hid underwater!", Text.WhiteSmoke), character.X, character.Y, 10);

                                    }
                                    break;
                            }

                            RefreshCharacterSwapLock(character, map, hitlist);
                        }
                        break;
                    case "Invisible": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " became invisible!", Text.WhiteSmoke), character.X, character.Y, 10);
                            RefreshCharacterVisibility(character, map, hitlist);
                        }
                        break;
                    case "PerishCount": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s perish count fell to " + counter + "!", Text.BrightRed), character.X, character.Y, 10);
                        }
                        break;
                    case "Curse": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg("A curse was placed on " + character.Name + "!", Text.BrightRed), character.X, character.Y, 10);
                            newStatus.Emoticon = 99;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Grudge": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " wants a foe to bear a grudge!", Text.BrightRed), character.X, character.Y, 10);
                            newStatus.Emoticon = 123;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "FutureSight": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was targeted by Future Sight!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 173;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Yawn": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " became drowsy!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 14;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Sleepless": {
                            if (character.StatusAilment == Enums.StatusAilment.Sleep) {
                                character.StatusAilment = Enums.StatusAilment.OK;
                                character.StatusAilmentCounter = 0;
                                if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was awakened!", Text.WhiteSmoke), character.X, character.Y, 10);
                                if (character.CharacterType == Enums.CharacterType.Recruit) {
                                    PacketBuilder.AppendStatusAilment(((Recruit)character).Owner, hitlist);
                                } else {
                                    PacketBuilder.AppendNpcStatusAilment((MapNpc)character, hitlist);
                                }
                            }
                            RemoveExtraStatus(character, map, "Yawn", hitlist);
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " became sleepless!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 88;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Grounded": {
                            DropToGround(character, map, hitlist, false);
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " dropped to the ground!", Text.WhiteSmoke), character.X, character.Y, 10);
                        }
                        break;
                    case "Protect": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " protected itself!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 165;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "WideGuard": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " became protected from wide-range attacks!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 151;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "QuickGuard": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " became protected from far-range attacks!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 109;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Endure": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " braced itself!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 145;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "MagicCoat": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was protected by Magic Coat!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 95;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "MagnetRise": {
                            RemoveExtraStatus(character, map, "Grounded", hitlist, false);
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " levitated using Magnet Rise!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 125;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Conversion": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " has Conversion up!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 162;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Conversion2": {
                            if (HasActiveBagItem(character, 51, 0, 0)) {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " 's item activated!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 176;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        } else {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " has Conversion 2 up!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 176;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        }
                        break;
                    case "Telekinesis": {
                            RemoveExtraStatus(character, map, "Grounded", hitlist, false);
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was hurled into the air!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 83;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Autotomize": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " became lighter!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 181;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Counter": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is set to counter physical attacks!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 191;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "MirrorCoat": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is set to reflect special attacks!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 81;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "MetalBurst": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is set to reflect attacks!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 53;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "DestinyBond": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is trying to take its foe with it!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 43;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Rebound": {
                            if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is set to counter attacks!", Text.WhiteSmoke), character.X, character.Y, 10);
                            newStatus.Emoticon = 159;
                            RefreshCharacterVolatileStatus(character, map, hitlist);
                        }
                        break;
                    case "Illusion": {
                        if (msg) hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " hid behind an illusion!", Text.WhiteSmoke), character.X, character.Y, 10);
                        RefreshCharacterSprite(character, map, hitlist);
                        }
                        break;
                    case "DefenseCurl":
                    case "Minimize":
                    case "Rampage":
                    case "Rolling":
                    case "FuryCutter":
                    case "EchoedVoice":
                    case "TimesLastMoveUsed":
                    case "LastHitBy":
                    case "LastMoveHitBy":
                    case "LastMoveHitByOther": {

                        }
                        break;
                    case "LastUSedMoveSlot": {
                        RefreshCharacterMoves(character, map, hitlist);
                        }
                        break;
                }

            }

            //if (character.CharacterType == Enums.CharacterType.Recruit) {
            //    PacketBuilder.AppendVolatileStatus(((Recruit)character).Owner, hitlist);
            //} else if (character.CharacterType == Enums.CharacterType.MapNpc) {
            //    PacketBuilder.AppendNpcVolatileStatus(map, hitlist, ((MapNpc)character).MapSlot);
            //}

            //RefreshCharacterTraits(character, map, hitlist);

            PacketHitList.MethodEnded(ref hitlist);
        }
Пример #5
0
        public static void RefreshCharacterMobility(ICharacter character, IMap map, PacketHitList hitlist)
        {
            PacketHitList.MethodStart(ref hitlist);
            //Mobility

            for (int i = 0; i < character.Mobility.Length; i++) {
                character.Mobility[i] = false;
            }

            if (character.Type1 == Enums.PokemonType.Ground || character.Type2 == Enums.PokemonType.Ground) {
                character.Mobility[8] = true;
            }

            if (character.Type1 == Enums.PokemonType.Water || character.Type2 == Enums.PokemonType.Water) {
                character.Mobility[1] = true;
            }
            if (character.Type1 == Enums.PokemonType.Fire || character.Type2 == Enums.PokemonType.Fire) {
                character.Mobility[3] = true;
            }
            if ((character.Type1 == Enums.PokemonType.Flying || character.Type2 == Enums.PokemonType.Flying)
            && IsGroundImmune(character, map)) {
                character.Mobility[1] = true;
                character.Mobility[2] = true;
                character.Mobility[3] = true;
                character.Mobility[8] = true;
                //character.Mobility[5] = true;
            }
            if (character.Type1 == Enums.PokemonType.Ghost || character.Type2 == Enums.PokemonType.Ghost) {
                character.Mobility[1] = true;
                character.Mobility[2] = true;
                character.Mobility[3] = true;
                character.Mobility[4] = true;
                //character.Mobility[6] = true;
                //character.Mobility[7] = true;
            }

            if (character.Type1 == Enums.PokemonType.Ice || character.Type2 == Enums.PokemonType.Ice) {
                character.Mobility[5] = true;
            }

            if (character.Type1 == Enums.PokemonType.Bug || character.Type2 == Enums.PokemonType.Bug) {
                character.Mobility[6] = true;
            }

            if (character.Type1 == Enums.PokemonType.Grass || character.Type2 == Enums.PokemonType.Grass) {
                character.Mobility[7] = true;
            }

            if (character.VolatileStatus.GetStatus("Slip") != null) {
                character.Mobility[1] = true;
            }
            if (character.HasActiveItem(146)) {
                for (int i = 0; i < character.Mobility.Length; i++) {
                    character.Mobility[i] = true;
                }
            }
            if (character.VolatileStatus.GetStatus("SuperMobile") != null) {
                for (int i = 0; i < character.Mobility.Length; i++) {
                    character.Mobility[i] = true;
                }
            }

            if (HasAbility(character, "Levitate") || character.HasActiveItem(82)) {
                if (IsGroundImmune(character, map)) {
                    character.Mobility[1] = true;
                    character.Mobility[2] = true;
                    character.Mobility[3] = true;
                }
            }

            if (character.HasActiveItem(349)) {
                character.Mobility[1] = true;
            }

            if (character.HasActiveItem(805)) {
                character.Mobility[3] = true;
            }

            if (character.HasActiveItem(814)) {
                for (int i = 0; i < character.Mobility.Length; i++) {
                    character.Mobility[i] = false;
                }
            }

            if (character.CharacterType == Enums.CharacterType.Recruit) {
                PacketBuilder.AppendMobility(((Recruit)character).Owner, hitlist);
            }
            PacketHitList.MethodEnded(ref hitlist);
        }
Пример #6
0
        public static void RefreshCharacterSpeedLimit(ICharacter character, IMap map, PacketHitList hitlist)
        {
            PacketHitList.MethodStart(ref hitlist);
            //Movement Speed
            ExtraStatus status;

            int speed = 4;

            if (character.Species == 492 && character.Form == 1) {
                speed++;
            }

            if (character.HasActiveItem(118)) {
                speed -= 2;
            }

            if (character.HasActiveItem(111)) {
                speed -=1;
            }

            if ((GetCharacterWeather(character) == Enums.Weather.Snowing || GetCharacterWeather(character) == Enums.Weather.Snowstorm) && (character.Type1 == Enums.PokemonType.Ice || character.Type2 == Enums.PokemonType.Ice)) {
                speed++;
            }

            if (HasActiveBagItem(character, 3, -1, (int)GetCharacterWeather(character)) || HasActiveBagItem(character, 3, (int)GetCharacterWeather(character), -1)) {
                speed++;
            }

            //Type Gems
            if (character.HasActiveItem(598) && GetCharacterWeather(character) == Enums.Weather.Sunny) {
                speed++;
            }
            if (character.HasActiveItem(599) && GetCharacterWeather(character) == Enums.Weather.Cloudy) {
                speed++;
            }
            if (character.HasActiveItem(601) && (GetCharacterWeather(character) == Enums.Weather.None || GetCharacterWeather(character) == Enums.Weather.Ambiguous)) {
                speed++;
            }
            if (character.HasActiveItem(604) && (GetCharacterWeather(character) == Enums.Weather.None || GetCharacterWeather(character) == Enums.Weather.Ambiguous)) {
                speed++;
            }
            if (character.HasActiveItem(607) && GetCharacterWeather(character) == Enums.Weather.Sandstorm) {
                speed++;
            }
            if (character.HasActiveItem(608) && GetCharacterWeather(character) == Enums.Weather.Fog) {
                speed++;
            }

            if (HasAbility(character, "Speed Boost")) {
                speed++;
            }
            status = character.VolatileStatus.GetStatus("MovementSpeed");
            if (status != null) {
                speed += status.Counter;
            }

            if (character.StatusAilment == Enums.StatusAilment.Paralyze) {
                if (HasAbility(character, "Quick Feet")) {
                    speed++;
                } else if (speed > 3) {

                    speed = 3;
                }
            } else if (character.StatusAilment != Enums.StatusAilment.OK) {
                if (HasAbility(character, "Quick Feet")) {
                    speed++;
                }
            }

            if (speed > 6) speed = 6;
            if (speed < 1) speed = 1;

            if (map != null
            && (map.Moral == Enums.MapMoral.None || map.Moral == Enums.MapMoral.NoPenalty
            || (character.X >= 0 && character.X <= map.MaxX
            && character.Y >= 0 && character.Y <= map.MaxY
            && map.Tile[character.X, character.Y].Type == Enums.TileType.Arena))) {
                character.SpeedLimit = (Enums.Speed)speed;

            } else {
                character.SpeedLimit = Enums.Speed.Running;
            }

            if (character.VolatileStatus.GetStatus("Immobilize") != null ||
                character.VolatileStatus.GetStatus("Ingrain") != null ||
                character.VolatileStatus.GetStatus("FireSpin") != null ||
                character.VolatileStatus.GetStatus("Whirlpool") != null ||
                character.VolatileStatus.GetStatus("Infestation") != null ||
                character.VolatileStatus.GetStatus("SandTomb") != null ||
                character.VolatileStatus.GetStatus("MagmaStorm") != null ||
                character.VolatileStatus.GetStatus("Bind:0") != null ||
                character.VolatileStatus.GetStatus("Clamp:0") != null ||
                character.VolatileStatus.GetStatus("Wrap:0") != null ||
                character.VolatileStatus.GetStatus("SkyDrop:0") != null ||
                character.VolatileStatus.GetStatus("Bind:1") != null ||
                character.VolatileStatus.GetStatus("Clamp:1") != null ||
                character.VolatileStatus.GetStatus("Wrap:1") != null ||
                character.VolatileStatus.GetStatus("SkyDrop:1") != null ||
                character.VolatileStatus.GetStatus("SolarBeam") != null ||
                character.VolatileStatus.GetStatus("RazorWind") != null ||
                character.VolatileStatus.GetStatus("FocusPunch") != null ||
                character.VolatileStatus.GetStatus("Dig") != null ||
                character.VolatileStatus.GetStatus("Dive") != null ||
                character.VolatileStatus.GetStatus("Bide") != null ||
                character.VolatileStatus.GetStatus("Avalanche") != null ||
                character.VolatileStatus.GetStatus("VitalThrow") != null ||
                character.VolatileStatus.GetStatus("Attract") != null) {
                character.SpeedLimit = Enums.Speed.Standing;
            }

            if (character.CharacterType == Enums.CharacterType.Recruit) {

                PacketBuilder.AppendSpeedLimit(((Recruit)character).Owner, hitlist);
            }
            PacketHitList.MethodEnded(ref hitlist);
        }
Пример #7
0
        public static bool IsGroundImmune(ICharacter character, IMap map)
        {
            bool immune = false;
            if (character.Type1 == Enums.PokemonType.Flying || character.Type2 == Enums.PokemonType.Flying) {
                immune = true;
            }
            if (character.VolatileStatus.GetStatus("Roost") != null) {
                immune = false;
            }
            if (HasAbility(character, "Levitate")) {
                immune = true;
            }
            if (character.VolatileStatus.GetStatus("MagnetRise") != null) {
                immune = true;
            }
            if (character.VolatileStatus.GetStatus("Telekinesis") != null) {
                immune = true;
            }
            if (character.HasActiveItem(82)) {
                immune = true;
            }

            if (character.HasActiveItem(111)) {
                immune = false;
            }

            if (character.VolatileStatus.GetStatus("Grounded") != null) {
                immune = false;
            }
            if (map != null && map.TempStatus.GetStatus("Gravity") != null) {
                immune = false;
            }
            return immune;
        }
Пример #8
0
        public static void RefreshCharacterDarkness(ICharacter character, IMap map, PacketHitList hitlist)
        {
            PacketHitList.MethodStart(ref hitlist);
            //sight range
            character.Darkness = -2;

            if (map != null && map.Darkness >= 0 && map.Darkness < 7 && HasAbility(character, "Keen Eye")) {
                character.Darkness = 7;
            }

            if (character.HasActiveItem(66)) {
                character.Darkness = -1;
            }
            if (character.HasActiveItem(348)) {
                character.Darkness = 0;
            }

            if (character.VolatileStatus.GetStatus("Blind") != null) {
                character.Darkness = 0;
            }

            if (character.CharacterType == Enums.CharacterType.Recruit) {
                PacketBuilder.AppendDarkness(((Recruit)character).Owner, hitlist);
            }
            PacketHitList.MethodEnded(ref hitlist);
        }
Пример #9
0
 public static void BlowBack(ICharacter character, IMap map, Enums.Direction dir, PacketHitList hitlist)
 {
     if (HasAbility(character, "Suction Cups")) {
         hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Suction Cups prevented it from being blown back!", Text.WhiteSmoke), character.X, character.Y, 10);
     } else if (character.HasActiveItem(111)) {
         hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Iron Ball prevented it from being blown back!", Text.WhiteSmoke), character.X, character.Y, 10);
     } else {
         WarpToNearestWall(character, map, dir, hitlist);
         hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was blown back!", Text.WhiteSmoke), character.X, character.Y, 10);
     }
 }
Пример #10
0
        public static bool CheckStatusProtection(ICharacter character, ICharacter attacker, IMap map, string status, string tag, bool msg, PacketHitList hitlist)
        {
            try {
            PacketHitList.MethodStart(ref hitlist);
            ExtraStatus checkStatus;
            string[] statusParam = status.Split(':');

            //if (statusParam[0] == "Confusion" && statusParam[1].ToInt() <= 0) {
            //    if (character.CharacterType == Enums.CharacterType.Recruit && ((Recruit)character).Owner.Player.Confusion <= 0) {
            //        PacketHitList.MethodEnded(ref hitlist);
            //        return true;
            //    } else if (character.CharacterType == Enums.CharacterType.MapNpc && !((MapNpc)character).Confused) {
            //        PacketHitList.MethodEnded(ref hitlist);
            //        return true;
            //    }

            //    if (character.HasActiveItem(347)) {
            //        if (msg) {
            //            hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can't recover from confusion due to the Blight Clay!", Text.BrightRed), character.X, character.Y, 10);
            //        }
            //        PacketHitList.MethodEnded(ref hitlist);
            //        return true;
            //    }
            //}

            if (IsStatusBad(status)) {
                if (character.VolatileStatus.GetStatus("Safeguard") != null && (attacker == null || !(HasAbility(attacker, "Infiltrator") || HasActiveBagItem(attacker, 7, 0, 0)))) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by Safeguard!", Text.BrightCyan), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                        //pokemon specific item
                        if (HasActiveBagItem(character, 4, -1, (int)GetCharacterWeather(character)) || HasActiveBagItem(character, 4, (int)GetCharacterWeather(character), -1) || HasActiveBagItem(character, 29, 0, 0)) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by its item!", Text.BrightCyan), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        //Type Gems
                        if (character.HasActiveItem(595) && GetCharacterWeather(character) == Enums.Weather.Cloudy) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by the White Gem!", Text.BrightCyan), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;

                        }
                        if (character.HasActiveItem(596) && GetCharacterWeather(character) == Enums.Weather.Sunny) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by the Fiery Gem!", Text.BrightCyan), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;

                        }
                        if (character.HasActiveItem(597) && (GetCharacterWeather(character) == Enums.Weather.Raining || GetCharacterWeather(character) == Enums.Weather.Thunder)) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by the Aqua Gem!", Text.BrightCyan), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;

                        }
                        if (character.HasActiveItem(600) && GetCharacterWeather(character) == Enums.Weather.Hail) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by the Icy Gem!", Text.BrightCyan), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;

                        }
                        if (character.HasActiveItem(602) && GetCharacterWeather(character) == Enums.Weather.Cloudy) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by the Poison Gem!", Text.BrightCyan), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;

                        }
                        if (character.HasActiveItem(603) && GetCharacterWeather(character) == Enums.Weather.Sandstorm) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by the Earth Gem!", Text.BrightCyan), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;

                        }
                        if (character.HasActiveItem(605) && GetCharacterWeather(character) == Enums.Weather.Fog) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by the Psyche Gem!", Text.BrightCyan), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;

                        }
                        if (character.HasActiveItem(606) && (GetCharacterWeather(character) == Enums.Weather.None || GetCharacterWeather(character) == Enums.Weather.Ambiguous)) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by the Guard Gem!", Text.BrightCyan), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;

                        }
                        if (character.HasActiveItem(609) && (GetCharacterWeather(character) == Enums.Weather.None || GetCharacterWeather(character) == Enums.Weather.Ambiguous)) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by the Dragon Gem!", Text.BrightCyan), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;

                        }
                        if (character.HasActiveItem(610) && GetCharacterWeather(character) == Enums.Weather.Fog) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by the Dark Gem!", Text.BrightCyan), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;

                        }
                        if (character.HasActiveItem(611) && GetCharacterWeather(character) == Enums.Weather.Sandstorm) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by the Metal Gem!", Text.BrightCyan), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;

                        }

                        if (HasAbility(character, "Leaf Guard") && GetCharacterWeather(character) == Enums.Weather.Sunny && !HasAbility(attacker, "Mold Breaker")) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by Leaf Guard!", Text.BrightCyan), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (attacker != character && statusParam[0] != "Pause" && statusParam[0] != "Taunt" &&
                            statusParam[0] != "Torment" && statusParam[0] != "Encore" && statusParam[0] != "MoveSeal" &&
                            statusParam[0] != "Disable" && statusParam[0] != "PerishCount" && statusParam[0] != "Curse" &&
                            statusParam[0] != "Attract" && statusParam[0] != "Grounded" && character.VolatileStatus.GetStatus("Substitute") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by Substitute!", Text.BrightCyan), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
            }

            switch (statusParam[0]) {
                case "OK": {
                        if (character.StatusAilment == Enums.StatusAilment.OK) {
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (character.HasActiveItem(347)) {
                            if (msg) {
                                switch (character.StatusAilment) {
                                    case Enums.StatusAilment.Burn: {
                                            hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can't recover from the burn due to the Blight Clay!", Text.BrightRed), character.X, character.Y, 10);
                                        }
                                        break;
                                    case Enums.StatusAilment.Freeze: {
                                            hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can't thaw out due to the Blight Clay!", Text.BrightRed), character.X, character.Y, 10);
                                        }
                                        break;
                                    case Enums.StatusAilment.Paralyze: {
                                            hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can't recover from paralysis due to the Blight Clay!", Text.BrightRed), character.X, character.Y, 10);
                                        }
                                        break;
                                    case Enums.StatusAilment.Poison: {
                                            hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can't recover from poison due to the Blight Clay!", Text.BrightRed), character.X, character.Y, 10);
                                        }
                                        break;
                                    case Enums.StatusAilment.Sleep: {
                                            hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can't wake up due to the Blight Clay!", Text.BrightRed), character.X, character.Y, 10);
                                        }
                                        break;
                                }
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Burn": {
                        if (character.StatusAilment == Enums.StatusAilment.OK) {
                            if (attacker == null || !(HasAbility(attacker, "Infiltrator") || HasActiveBagItem(attacker, 7, 0, 0))) {
                                checkStatus = character.VolatileStatus.GetStatus("Status Guard");
                                if (checkStatus != null && checkStatus.Tag == "1") {
                                    if (msg) {
                                        hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected from burns!", Text.BrightCyan), character.X, character.Y, 10);
                                    }
                                    PacketHitList.MethodEnded(ref hitlist);
                                    return true;
                                }
                            }

                            if (character.HasActiveItem(633)) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was protected by its Rawst Scarf!", Text.BrightRed), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }

                            if (HasAbility(character, "Water Veil") && !HasAbility(character, "Flare Boost") && !HasAbility(attacker, "Mold Breaker")) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Water Veil protected it from a burn!", Text.BrightRed), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }

                            if (character.Type1 == Enums.PokemonType.Fire || character.Type2 == Enums.PokemonType.Fire) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s type doesn't get burned!", Text.BrightRed), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }
                        } else if (character.StatusAilment == Enums.StatusAilment.Burn) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already burned!", Text.BrightRed), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        } else {
                            //if (msg) {
                            //	hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " wasn't burned", Text.BrightRed), character.X, character.Y, 10);
                            //}
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Freeze": {
                        if (character.StatusAilment == Enums.StatusAilment.OK) {
                            if (attacker == null || !(HasAbility(attacker, "Infiltrator") || HasActiveBagItem(attacker, 7, 0, 0))) {
                                checkStatus = character.VolatileStatus.GetStatus("Status Guard");
                                if (checkStatus != null && checkStatus.Tag == "2") {
                                    if (msg) {
                                        hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected from being frozen!", Text.BrightCyan), character.X, character.Y, 10);
                                    }
                                    PacketHitList.MethodEnded(ref hitlist);
                                    return true;
                                }
                            }

                            if (character.HasActiveItem(634)) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was protected by its Aspear Scarf!", Text.BrightRed), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }
                            if (HasAbility(character, "Magma Armor") && !HasAbility(attacker, "Mold Breaker")) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Magma Armor protected it from being frozen!", Text.BrightRed), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }

                            if (character.Type1 == Enums.PokemonType.Ice || character.Type2 == Enums.PokemonType.Ice) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s type doesn't get frozen!", Text.BrightRed), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }
                        } else if (character.StatusAilment == Enums.StatusAilment.Freeze) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already frozen!", Text.BrightRed), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        } else {
                            //if (msg) {
                            //	hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " wasn't burned", Text.BrightRed), character.X, character.Y, 10);
                            //}
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Paralyze": {
                        if (character.StatusAilment == Enums.StatusAilment.OK) {
                            if (attacker == null || !(HasAbility(attacker, "Infiltrator") || HasActiveBagItem(attacker, 7, 0, 0))) {
                                checkStatus = character.VolatileStatus.GetStatus("Status Guard");
                                if (checkStatus != null && checkStatus.Tag == "3") {
                                    if (msg) {
                                        hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected from paralysis!", Text.BrightCyan), character.X, character.Y, 10);
                                    }
                                    PacketHitList.MethodEnded(ref hitlist);
                                    return true;
                                }
                            }

                            if (character.HasActiveItem(632)) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was protected by its Cheri Scarf!", Text.BrightRed), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }
                            if (HasAbility(character, "Limber") && !HasAbility(attacker, "Mold Breaker")) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Limber prevented it from being paralyzed!", Text.BrightRed), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }
                        } else if (character.StatusAilment == Enums.StatusAilment.Paralyze) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already paralyzed!", Text.BrightRed), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        } else {
                            //if (msg) {
                            //	hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " wasn't burned", Text.BrightRed), character.X, character.Y, 10);
                            //}
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Poison": {
                        if (character.StatusAilment == Enums.StatusAilment.OK) {
                            if (attacker == null || !(HasAbility(attacker, "Infiltrator") || HasActiveBagItem(attacker, 7, 0, 0))) {
                                checkStatus = character.VolatileStatus.GetStatus("Status Guard");
                                if (checkStatus != null && checkStatus.Tag == "4") {
                                    if (msg) {
                                        hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected from poison!", Text.BrightCyan), character.X, character.Y, 10);
                                    }
                                    PacketHitList.MethodEnded(ref hitlist);
                                    return true;
                                }
                            }
                            if (HasAbility(character, "Immunity") && !HasAbility(character, "Toxic Boost") && !HasAbility(attacker, "Mold Breaker")) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Immunity prevented it from being poisoned!", Text.BrightRed), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }

                            if (character.Type1 == Enums.PokemonType.Poison || character.Type2 == Enums.PokemonType.Poison || character.Type1 == Enums.PokemonType.Steel || character.Type2 == Enums.PokemonType.Steel) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s type doesn't get poisoned!", Text.BrightRed), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }
                            if (character.HasActiveItem(483)) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was protected by its Pecha Scarf!", Text.BrightRed), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }
                        } else if (character.StatusAilment == Enums.StatusAilment.Poison) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already poisoned!", Text.BrightRed), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        } else {
                            //if (msg) {
                            //	hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " wasn't burned", Text.BrightRed), character.X, character.Y, 10);
                            //}
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                    }
                    break;
                case "Sleep": {
                        if (character.StatusAilment == Enums.StatusAilment.OK) {
                            if (attacker == null || !(HasAbility(attacker, "Infiltrator") || HasActiveBagItem(attacker, 7, 0, 0))) {
                                checkStatus = character.VolatileStatus.GetStatus("Status Guard");
                                if (checkStatus != null && checkStatus.Tag == "5") {
                                    if (msg) {
                                        hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected from paralysis!", Text.BrightCyan), character.X, character.Y, 10);
                                    }
                                    PacketHitList.MethodEnded(ref hitlist);
                                    return true;
                                }
                            }

                            //Sweet Veil
                            if (HasAbility(character, "Sweet Veil") && !HasAbility(attacker, "Mold Breaker")) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can't become drowsy due to Sweet Veil!", Text.BrightRed), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }

                            if (character.HasActiveItem(59)) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Insomniscope prevented it from falling asleep!", Text.WhiteSmoke), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }

                            if (character.VolatileStatus.GetStatus("Sleepless") != null) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can't fall asleep!", Text.BrightRed), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }

                            if (HasAbility(character, "Insomnia") && !HasAbility(attacker, "Mold Breaker")) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Insomnia prevented it from falling asleep!", Text.WhiteSmoke), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }

                            if (HasAbility(character, "Vital Spirit") && !HasAbility(attacker, "Mold Breaker")) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Vital Spirit prevented it from falling asleep!", Text.WhiteSmoke), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }

                        } else if (character.StatusAilment == Enums.StatusAilment.Sleep) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already asleep!", Text.BrightRed), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        } else {
                            //if (msg) {
                            //	hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " wasn't burned", Text.BrightRed), character.X, character.Y, 10);
                            //}
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Confusion": {

                    if (character.VolatileStatus.GetStatus("Confusion") != null) {
                        if (msg) {
                            hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already confused!", Text.BrightRed), character.X, character.Y, 10);
                        }
                        PacketHitList.MethodEnded(ref hitlist);
                        return true;
                    }

                    if ((attacker == null || !(HasAbility(attacker, "Infiltrator") || HasActiveBagItem(attacker, 7, 0, 0))) && character.VolatileStatus.GetStatus("Confusion Guard") != null) {
                        if (msg) {
                            hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected from confusion!", Text.BrightCyan), character.X, character.Y, 10);
                        }
                        PacketHitList.MethodEnded(ref hitlist);
                        return true;
                    }

                    if (character.HasActiveItem(323)) {
                        if (msg) {
                            hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Persim Band prevented confusion!", Text.BrightRed), character.X, character.Y, 10);
                        }
                        PacketHitList.MethodEnded(ref hitlist);
                        return true;
                    }
                        if (HasAbility(character, "Own Tempo") && !HasAbility(character, "Tangled Feet") && !HasAbility(attacker, "Mold Breaker")) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Own Tempo prevented it from becoming confused!", Text.BrightRed), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        //if (character.CharacterType == Enums.CharacterType.Recruit) {
                        //    if (((Recruit)character).Owner.Player.Confusion > 0 && statusParam[1].ToInt() > 0) {
                        //        if (msg) {
                        //            hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already confused!", Text.BrightRed), character.X, character.Y, 10);
                        //        }
                        //        PacketHitList.MethodEnded(ref hitlist);
                        //        return true;
                        //    }
                        //} else {
                        //    if (((MapNpc)character).Confused) {
                        //        if (msg) {
                        //            hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already confused!", Text.BrightRed), character.X, character.Y, 10);
                        //        }
                        //        PacketHitList.MethodEnded(ref hitlist);
                        //        return true;
                        //    }
                        //}
                    }
                    break;
                case "Cringe": {

                        if (HasAbility(character, "Inner Focus") && !HasAbility(attacker, "Mold Breaker")) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Inner Focus prevented it from cringing!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Immobilize": {
                        if (character.VolatileStatus.GetStatus("Immobilize") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already Immobilized!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (character.HasActiveItem(40)) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " was protected from being immobilized by the Shed Shell!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (HasAbility(character, "Run Away")) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " avoided immobilization with Run Away!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Nightmare": {
                        if (character.VolatileStatus.GetStatus("Nightmare") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already under the effects of Nightmare!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (character.HasActiveItem(498)) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg("The Lunar Wing protected " + character.Name + " from the nightmare!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "GastroAcid": {
                        if (character.VolatileStatus.GetStatus("GastroAcid") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already under the effects of Gastro Acid!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Attract": {
                        if (character.VolatileStatus.GetStatus("Attract") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already infatuated!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                        if (HasAbility(character, "Oblivious") && !HasAbility(attacker, "Mold Breaker")) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " avoided infatuation with Oblivious!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                        if (HasActiveBagItem(character, 14, 0, 0)) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by its item!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            return true;
                        }
                    }
                    break;
                case "Encore": {
                        if (HasActiveBagItem(character, 14, 0, 0)) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by its item!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            return true;
                        }
                    }
                    break;
                case "Torment": {
                        if (HasActiveBagItem(character, 14, 0, 0)) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by its item!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            return true;
                        }
                    }
                    break;
                case "Taunt": {
                        if (HasActiveBagItem(character, 14, 0, 0)) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is protected by its item!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            return true;
                        }
                    }
                    break;
                case "Embargo": {
                        if (character.VolatileStatus.GetStatus("Embargo") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already under the effects of Embargo!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "HealBlock": {
                        if (character.VolatileStatus.GetStatus("HealBlock") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already under the effects of Heal Block!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Substitute": {
                        if (character.VolatileStatus.GetStatus("Substitute") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " already has a substitute!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Ingrain": {
                        if (character.VolatileStatus.GetStatus("Ingrain") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " already has its roots planted!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "AquaRing": {
                        if (character.VolatileStatus.GetStatus("AquaRing") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " already has an Aqua Ring!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Wish": {
                        if (character.VolatileStatus.GetStatus("Wish") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already being wished upon!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Exposed": {
                        if (character.VolatileStatus.GetStatus("Exposed") != null) {
                            if (msg && !HasActiveBagItem(character, 20, 9, 0) && !HasActiveBagItem(character, 20, 6, 0)) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already exposed!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "MiracleEye": {
                        if (character.VolatileStatus.GetStatus("MiracleEye") != null) {
                            if (msg && !HasActiveBagItem(character, 20, 2, 0)) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can already hit Dark-type Pok�mon with Psychic-type moves!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Bind": {
                        if (character.VolatileStatus.GetStatus("Bind:0") != null && statusParam[1] == "0" ||
                            character.VolatileStatus.GetStatus("Bind:1") != null && statusParam[1] == "1") {
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (character.HasActiveItem(40) && statusParam[1] == "0") {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Shed Shell protected it from being trapped!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (HasAbility(character, "Run Away")) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " avoided being trapped with Run Away!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Clamp": {
                        if (character.VolatileStatus.GetStatus("Clamp:0") != null && statusParam[1] == "0" ||
                            character.VolatileStatus.GetStatus("Clamp:1") != null && statusParam[1] == "1") {
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (character.HasActiveItem(40) && statusParam[1] == "0") {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Shed Shell protected it from being trapped!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (HasAbility(character, "Run Away")) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " avoided being trapped with Run Away!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Wrap": {
                        if (character.VolatileStatus.GetStatus("Wrap:0") != null && statusParam[1] == "0" ||
                            character.VolatileStatus.GetStatus("Wrap:1") != null && statusParam[1] == "1") {
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (character.HasActiveItem(40) && statusParam[1] == "0") {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Shed Shell protected it from being trapped!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (HasAbility(character, "Run Away")) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " avoided being trapped with Run Away!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "FireSpin": {
                        if (character.VolatileStatus.GetStatus("FireSpin") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already trapped by Fire Spin!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (character.HasActiveItem(40)) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Shed Shell protected it from being trapped!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (HasAbility(character, "Run Away")) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " avoided being trapped with Run Away!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Whirlpool": {
                        if (character.VolatileStatus.GetStatus("Whirlpool") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already trapped by Whirlpool!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (character.HasActiveItem(40)) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Shed Shell protected it from being trapped!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (HasAbility(character, "Run Away")) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " avoided being trapped with Run Away!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Infestation": {
                        if (character.VolatileStatus.GetStatus("Infesation") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already trapped by an Infestation!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (character.HasActiveItem(40)) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Shed Shell protected it from being trapped!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (HasAbility(character, "Run Away")) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " avoided being trapped with Run Away!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "SandTomb": {
                        if (character.VolatileStatus.GetStatus("SandTomb") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already trapped by Sand Tomb!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (character.HasActiveItem(40)) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Shed Shell protected it from being trapped!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (HasAbility(character, "Run Away")) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " avoided being trapped with Run Away!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "MagmaStorm": {
                        if (character.VolatileStatus.GetStatus("MagmaStorm") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already trapped by Magma Storm!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (character.HasActiveItem(40)) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s Shed Shell protected it from being trapped!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (HasAbility(character, "Run Away")) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " avoided being trapped with Run Away!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "LeechSeed": {
                        if (statusParam[1] == "0") {

                            if (character.VolatileStatus.GetStatus("LeechSeed") != null) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " already has a Leech Seed!", Text.WhiteSmoke), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }

                            if (character.Type1 == Enums.PokemonType.Grass || character.Type2 == Enums.PokemonType.Grass) {
                                if (msg) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " didn't take on the Leech Seed.", Text.WhiteSmoke), character.X, character.Y, 10);
                                }
                                PacketHitList.MethodEnded(ref hitlist);
                                return true;
                            }
                        }
                    }
                    break;
                case "TypeReduce": {
                        checkStatus = character.VolatileStatus.GetStatus("TypeReduce");
                        if (checkStatus != null && statusParam[1].ToInt() == checkStatus.Counter) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " already takes reduced damage from " + (Enums.PokemonType)statusParam[1].ToInt() + " -type moves!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "TypeBoost": {
                        checkStatus = character.VolatileStatus.GetStatus("TypeBoost");
                        if (checkStatus != null && statusParam[1].ToInt() == checkStatus.Counter) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s " + (Enums.PokemonType)statusParam[1].ToInt() + " -type moves are already boosted!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "AttackReturn": {
                        checkStatus = character.VolatileStatus.GetStatus("AttackReturn");
                        if (checkStatus != null && statusParam[1].ToInt() == checkStatus.Counter) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already set to counter " + (Enums.MoveCategory)statusParam[1].ToInt() + " moves!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "FlashFire": {
                        if (character.VolatileStatus.GetStatus("FlashFire") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already powered up by Flash Fire!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "MoveSeal": {
                        if (character.Moves[statusParam[1].ToInt()].MoveNum <= 0) {
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (character.VolatileStatus.GetStatus(status) != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s " + MoveManager.Moves[character.Moves[statusParam[1].ToInt()].MoveNum].Name + " is already sealed!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Disable": {
                        if (character.Moves[statusParam[1].ToInt()].MoveNum == 0) {
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (character.VolatileStatus.GetStatus("Disable") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " already has a move disabled!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Stockpile": {
                    checkStatus = character.VolatileStatus.GetStatus("Stockpile");
                        if (checkStatus != null && checkStatus.Counter >= 3) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can't stockpile any more!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Roost": {
                        if (map.Tile[character.X, character.Y].Type == Enums.TileType.MobileBlock) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can't land here!", Text.BrightRed), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "PerishCount": {
                    checkStatus = character.VolatileStatus.GetStatus("PerishCount");
                        if (checkStatus != null && checkStatus.Counter <= statusParam[1].ToInt()) {
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "FutureSight": {
                        if (character.VolatileStatus.GetStatus("FutureSight") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already targeted by Future Sight!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "FocusEnergy": {
                        if (character.VolatileStatus.GetStatus("FocusEnergy") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already focused!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Yawn": {

                        if (character.VolatileStatus.GetStatus("Sleepless") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can't become drowsy its sleeplessness!", Text.BrightRed), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (HasAbility(character, "Insomnia") && !HasAbility(attacker, "Mold Breaker")) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can't become drowsy due to Insomnia!", Text.BrightRed), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (HasAbility(character, "Vital Spirit") && !HasAbility(attacker, "Mold Breaker")) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can't become drowsy due to Vital Spirit!", Text.BrightRed), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (character.VolatileStatus.GetStatus("Yawn") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already yawning!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (character.StatusAilment != Enums.StatusAilment.OK) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " didn't yawn!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Sleepless": {
                        if (character.StatusAilment == Enums.StatusAilment.Sleep && character.HasActiveItem(347)) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " can't wake up due to the Blight Clay!", Text.BrightRed), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }

                        if (character.VolatileStatus.GetStatus("Sleepless") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already sleepless!", Text.BrightRed), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Status Guard": {
                    checkStatus = character.VolatileStatus.GetStatus("Status Guard");
                        if (checkStatus != null && tag == checkStatus.Tag) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already protected from the " + (Enums.StatusAilment)tag.ToInt() + " status!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Confusion Guard": {
                        if (character.VolatileStatus.GetStatus("Confusion Guard") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already protected from confusion", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Wide Guard": {
                        if (character.VolatileStatus.GetStatus("WideGuard") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already protected by Wide Guard!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Quick Guard": {
                        if (character.VolatileStatus.GetStatus("QuickGuard") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already protected by Quick Guard!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Protect": {
                        if (character.VolatileStatus.GetStatus("Protect") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already protected!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Endure": {
                        if (character.VolatileStatus.GetStatus("Endure") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already enduring!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "MagicCoat": {
                        if (character.VolatileStatus.GetStatus("MagicCoat") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already protected by Magic Coat!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "MagnetRise": {
                        if (character.VolatileStatus.GetStatus("MagnetRise") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already levitating with Magnet Rise!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Telekinesis": {
                        if (character.VolatileStatus.GetStatus("Telekinesis") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " is already floating from Telekinesis!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "Counter": {
                        if (character.VolatileStatus.GetStatus("Counter") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " already has Counter up!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "MirrorCoat": {
                        if (character.VolatileStatus.GetStatus("MirrorCoat") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " already has Mirror Coat up!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "MetalBurst": {
                        if (character.VolatileStatus.GetStatus("MetalBurst") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " already has Metal Burst up!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;
                case "DestinyBond": {
                        if (character.VolatileStatus.GetStatus("DestinyBond") != null) {
                            if (msg) {
                                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + " already has Destiny Bond up!", Text.WhiteSmoke), character.X, character.Y, 10);
                            }
                            PacketHitList.MethodEnded(ref hitlist);
                            return true;
                        }
                    }
                    break;

            }

            PacketHitList.MethodEnded(ref hitlist);
            return false;
            } catch (Exception ex) {
                Messenger.AdminMsg("Error: CheckStatusProtection " + status + " " + tag, Text.Black);

                Messenger.AdminMsg(ex.ToString(), Text.Black);

                return false;
            }
        }
Пример #11
0
        public static bool WillTrapActivate(ICharacter character, IMap map, int x, int y)
        {
            Tile tile = map.Tile[x, y];
            bool willActivate = true;

            if (character.CharacterType == Enums.CharacterType.MapNpc) {
                if (tile.String1 == "") willActivate = false;

                if (NpcManager.Npcs[((MapNpc)character).Num].Behavior == Enums.NpcBehavior.Friendly) willActivate = false;

            } else if (character.CharacterType == Enums.CharacterType.Recruit) {
                if (((Recruit)character).Owner.Player.CharID == tile.String1) {
                    willActivate = false;
                } else if (!string.IsNullOrEmpty(((Recruit)character).Owner.Player.GuildName) && ((Recruit)character).Owner.Player.GuildName == tile.String2) {
                    willActivate = false;
                } else if (((Recruit)character).Owner.Player.IsInParty()) {
                    Server.Players.Parties.Party party = PartyManager.FindPlayerParty(((Recruit)character).Owner);
                    if (party != null) {
                        if (party.IsPlayerInParty(tile.String1)) {
                            willActivate = false;
                        }
                    }
                }

                //if (((Recruit)character).Owner.Player.PK) willActivate = true;
            }

            if (character.HasActiveItem(142)) willActivate = false;

            return willActivate;
        }
Пример #12
0
        public static void RandomWarp(ICharacter character, IMap warpMap, bool msg, PacketHitList hitlist, int startX, int endX, int startY, int endY)
        {
            if (HasAbility(character, "Suction Cups")) {
                if (msg) {
                    hitlist.AddPacketToMap(warpMap, PacketBuilder.CreateBattleMsg(character.Name + "'s Suction Cups prevented it from being warped!", Text.WhiteSmoke), character.X, character.Y, 10);
                }
            } else if (character.HasActiveItem(111)) {
                if (msg) {
                    hitlist.AddPacketToMap(warpMap, PacketBuilder.CreateBattleMsg(character.Name + "'s Iron Ball prevented it from being warped!", Text.WhiteSmoke), character.X, character.Y, 10);
                }
            } else {
                PacketHitList.MethodStart(ref hitlist);

                if (startX < 0) startX = 0;
                if (startX > warpMap.MaxX) startX = warpMap.MaxX;
                if (endX < 0) endX = 0;
                if (endX > warpMap.MaxX) endX = warpMap.MaxX;
                if (startY < 0) startY = 0;
                if (startY > warpMap.MaxY) startY = warpMap.MaxY;
                if (endY < 0) endY = 0;
                if (endY > warpMap.MaxY) endY = warpMap.MaxY;

                int x, y;

                FindFreeTile(warpMap, startX, startY, endX, endY, out x, out y);

                if (x == -1) {
                    if (msg) {
                        hitlist.AddPacketToMap(warpMap, PacketBuilder.CreateBattleMsg(character.Name + " didn't warp.", Text.BrightRed), character.X, character.Y, 10);
                    }
                } else {
                    PointWarp(character, warpMap, hitlist, x, y);
                }
                PacketHitList.MethodEnded(ref hitlist);
            }
        }
Пример #13
0
        public static void PointWarp(ICharacter character, IMap warpMap, PacketHitList hitlist, int X, int Y, bool msg)
        {
            if (HasAbility(character, "Suction Cups")) {
                if (msg) {
                    hitlist.AddPacketToMap(warpMap, PacketBuilder.CreateBattleMsg(character.Name + "'s Suction Cups prevented it from being warped!", Text.WhiteSmoke), character.X, character.Y, 10);
                }
            } else if (character.HasActiveItem(111)) {
                if (msg) {
                    hitlist.AddPacketToMap(warpMap, PacketBuilder.CreateBattleMsg(character.Name + "'s Iron Ball prevented it from being warped!", Text.WhiteSmoke), character.X, character.Y, 10);
                }
            } else {
                PacketHitList.MethodStart(ref hitlist);

                if (msg) {
                    hitlist.AddPacketToMap(warpMap, PacketBuilder.CreateBattleMsg(character.Name + " warped!", Text.WhiteSmoke), character.X, character.Y, 10);
                }

                character.X = X;
                character.Y = Y;

                if (character.CharacterType == Enums.CharacterType.Recruit) {
                    PacketBuilder.AppendPlayerXY(((Recruit)character).Owner, hitlist);
                } else if (character.CharacterType == Enums.CharacterType.MapNpc) {
                    PacketBuilder.AppendNpcXY(warpMap, hitlist, ((MapNpc)character).MapSlot);
                }

                PacketHitList.MethodEnded(ref hitlist);
            }
        }
Пример #14
0
        public static void OnStep(IMap map, ICharacter character, Enums.Speed speed, PacketHitList hitlist)
        {
            try {
                ExtraStatus status;
                PacketHitList.MethodStart(ref hitlist);
                if (speed != Enums.Speed.Slip) {
                    int stepCounter;
                    if (character.CharacterType == Enums.CharacterType.Recruit) {

                        ((Recruit)character).Owner.Player.HPStepCounter++;
                        if (((Recruit)character).Owner.Player.Map.HungerEnabled) {
                            if (character.HasActiveItem(151)) {
                                ((Recruit)character).Owner.Player.BellyStepCounter += 5;
                            } else if (character.HasActiveItem(152)) {
                                //nothing
                            } else if (character.HasActiveItem(162)) {
                                ((Recruit)character).Owner.Player.BellyStepCounter += 20;
                            } else {
                                ((Recruit)character).Owner.Player.BellyStepCounter += 10;
                            }
                            if (HasAbility(character, "Gluttony")) {
                                ((Recruit)character).Owner.Player.BellyStepCounter += 10;
                            }
                        }
                        stepCounter = ((Recruit)character).Owner.Player.HPStepCounter;
                        ElectrostasisTower.OnPlayerStep(((Recruit)character).Owner);

                        if (stepCounter % 5 == 0) {
                            if (map.MapID == MapManager.GenerateMapID(737)) {
                                bool hasBeenWelcomed = ((Recruit)character).Owner.Player.StoryHelper.ReadSetting("[Gameplay]-HasBeenWelcomed").ToBool();
                                if (!hasBeenWelcomed) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateChatMsg(((Recruit)character).Owner.Player.Name + " is new to " + Settings.GameNameShort + "! Welcome!", Text.BrightGreen));
                                    ((Recruit)character).Owner.Player.StoryHelper.SaveSetting("[Gameplay]-HasBeenWelcomed", "True");
                                }
                            }
                        }
                    } else {
                        ((MapNpc)character).HPStepCounter++;
                        stepCounter = ((MapNpc)character).HPStepCounter;
                    }

                    if (MapManager.IsMapActive(character.MapID)) {

                        RemoveExtraStatus(character, map, "Roost", hitlist);
                        RemoveExtraStatus(character, map, "Endure", hitlist);
                        RemoveExtraStatus(character, map, "DestinyBond", hitlist);
                        status = character.VolatileStatus.GetStatus("Rage");
                        if (status != null) {
                            status.Counter--;
                            if (status.Counter <= 0) {
                                RemoveExtraStatus(character, map, "Rage", hitlist);
                            }
                        }
                        status = character.VolatileStatus.GetStatus("MetalBurst");
                        if (status != null) {
                            status.Counter--;
                            if (status.Counter <= 0) {
                                RemoveExtraStatus(character, map, "MetalBurst", hitlist);
                            }
                        }
                        //if (character.VolatileStatus.GetStatus("Taunt") != null) {
                        //	character.VolatileStatus.GetStatus("Taunt").Counter--;
                        //	if (character.VolatileStatus.GetStatus("Taunt").Counter <= 0) {
                        //		RemoveExtraStatus(character, map, "Taunt", hitlist);
                        //	}
                        //}

                        Tile steppedTile = map.Tile[character.X, character.Y];
                        if (steppedTile.Type == Enums.TileType.MobileBlock) {
                            if (steppedTile.Data1 % 32 >= 16) {
                                if (character.CharacterType == Enums.CharacterType.Recruit) {
                                    if (((Recruit)character).Owner.Player.Map.HungerEnabled && character.VolatileStatus.GetStatus("SuperMobile") == null) {
                                        ((Recruit)character).Owner.Player.BellyStepCounter += 400;
                                    }
                                }
                            } else if (steppedTile.Data1 % 4 >= 2) {
                                if (steppedTile.String1 == "1") {
                                    if (!CheckStatusProtection(character, map, Enums.StatusAilment.Burn.ToString(), false, hitlist)) {
                                        hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg("The water's boiling hot!", Text.BrightRed), character.X, character.Y, 10);
                                        SetStatusAilment(character, map, Enums.StatusAilment.Burn, 0, hitlist);
                                    }
                                } else if (steppedTile.String1 == "2") {
                                    if (!CheckStatusProtection(character, map, Enums.StatusAilment.Freeze.ToString(), false, hitlist)) {
                                        hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg("The water's freezing cold!", Text.BrightRed), character.X, character.Y, 10);
                                        SetStatusAilment(character, map, Enums.StatusAilment.Freeze, 0, hitlist);
                                    }
                                } else if (steppedTile.String1 == "3") {
                                    if (!CheckStatusProtection(character, map, Enums.StatusAilment.Paralyze.ToString(), false, hitlist)) {
                                        hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg("The water is numbing!", Text.BrightRed), character.X, character.Y, 10);
                                        SetStatusAilment(character, map, Enums.StatusAilment.Paralyze, 0, hitlist);
                                    }
                                } else if (steppedTile.String1 == "4") {
                                    if (!CheckStatusProtection(character, map, Enums.StatusAilment.Poison.ToString(), false, hitlist)) {
                                        hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg("The water's poisoned!", Text.BrightRed), character.X, character.Y, 10);
                                        SetStatusAilment(character, map, Enums.StatusAilment.Poison, 1, hitlist);
                                    }
                                } else if (steppedTile.String1 == "5") {
                                    if (!CheckStatusProtection(character, map, Enums.StatusAilment.Sleep.ToString(), false, hitlist)) {
                                        hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg("The water is oddly calming...", Text.BrightRed), character.X, character.Y, 10);
                                        SetStatusAilment(character, map, Enums.StatusAilment.Sleep, 3, hitlist);
                                    }
                                } else if (character.StatusAilment == Enums.StatusAilment.Burn && !CheckStatusProtection(character, map, Enums.StatusAilment.OK.ToString(), false, hitlist)) {
                                    SetStatusAilment(character, map, Enums.StatusAilment.OK, 0, hitlist);
                                }
                            } else if (steppedTile.Data1 % 16 >= 8 && !character.HasActiveItem(805) &&
                                !CheckStatusProtection(character, map, Enums.StatusAilment.Burn.ToString(), false, hitlist)) {
                                SetStatusAilment(character, map, Enums.StatusAilment.Burn, 0, hitlist);
                            }
                        }

                    }

                    if (stepCounter % 5 == 0) {
                        if (character.HasActiveItem(344) && map.MapType == Enums.MapType.RDungeonMap && Server.Math.Rand(0, 3) == 0) {
                            RandomWarp(character, map, false, hitlist);
                        }

                        int newHP = character.HP;

                        //subtract weather damage, sticky items
                        if (stepCounter % 10 == 0) {

                            //Overcoat
                            bool overcoat = false;

                            TargetCollection targets = MoveProcessor.GetTargetsInRange(Enums.MoveRange.Room, 10, map, character, character.X, character.Y, Enums.Direction.Up, false, true, true);

                            for (int i = 0; i < targets.Count; i++) {

                                if (HasAbility(targets[i], "Overcoat") || HasActiveBagItem(character, 47, 0, 0)) {

                                    overcoat = true;
                                    break;
                                }
                            }

                            switch (GetCharacterWeather(character)) {
                                case (Enums.Weather.Hail): {
                                    if (HasAbility(character, "Ice Body") && (character.CharacterType == Enums.CharacterType.MapNpc || ((Recruit)character).Belly > 0)) {
                                            newHP += 6;
                                        }
                                        if (HasAbility(character, "Snow Cloak")) {
                                        } else if (HasAbility(character, "Ice Body")) {
                                        } else if (HasAbility(character, "Magic Guard")) {
                                        } else if (character.Type1 == Enums.PokemonType.Ice || character.Type2 == Enums.PokemonType.Ice) {

                                        } else if (overcoat) {
                                        } else {
                                            newHP -= 6;
                                        }
                                    }
                                    break;
                                case (Enums.Weather.Sandstorm): {
                                        if (HasAbility(character, "Magic Guard")) {
                                        } else if (HasAbility(character, "Sand Veil")) {
                                        } else if (HasAbility(character, "Sand Force")) {
                                        } else if (character.Type1 == Enums.PokemonType.Rock || character.Type2 == Enums.PokemonType.Rock) {
                                        } else if (character.Type1 == Enums.PokemonType.Ground || character.Type2 == Enums.PokemonType.Ground) {
                                        } else if (character.Type1 == Enums.PokemonType.Steel || character.Type2 == Enums.PokemonType.Steel) {
                                        } else if (overcoat) {
                                        } else {
                                            newHP -= 5;
                                        }
                                    }
                                    break;
                                case (Enums.Weather.Sunny): {
                                        if (HasAbility(character, "Dry Skin") && !overcoat && !HasAbility(character, "Magic Guard")) {
                                            newHP -= 5;
                                        }
                                        if (HasAbility(character, "Solar Power") && !overcoat && !HasAbility(character, "Magic Guard")) {
                                            newHP -= 5;
                                        }
                                    }
                                    break;
                                case (Enums.Weather.Thunder):
                                case (Enums.Weather.Raining): {
                                        if (HasAbility(character, "Dry Skin") && (character.CharacterType == Enums.CharacterType.MapNpc || ((Recruit)character).Belly > 0)) {
                                            newHP += 5;
                                        }
                                        if (HasAbility(character, "Rain Dish") && (character.CharacterType == Enums.CharacterType.MapNpc || ((Recruit)character).Belly > 0)) {
                                            newHP += 5;
                                        }
                                    }
                                    break;
                            }

                            if (character.HasActiveItem(431)) {
                                Sticky(character, map, hitlist);
                            }
                        }

                        if (character.CharacterType == Enums.CharacterType.Recruit && ((Recruit)character).Belly <= 0) {
                            newHP -= 5;
                            hitlist.AddPacket(((Recruit)character).Owner, PacketBuilder.CreateSoundPacket("magic129.wav"));
                        }

                        //add HP based on natural healing
                        int h = 0;

                        if ((character.CharacterType == Enums.CharacterType.MapNpc || ((Recruit)character).Belly > 0) && character.StatusAilment != Enums.StatusAilment.Poison) {
                            h += 100;
                        }

                        if (character.StatusAilment == Enums.StatusAilment.Poison) {
                            if (HasAbility(character, "Poison Heal") && (character.CharacterType == Enums.CharacterType.MapNpc || ((Recruit)character).Belly > 0)) {
                                h += (200 * character.StatusAilmentCounter);
                            } else if (HasAbility(character, "Magic Guard") && (character.CharacterType == Enums.CharacterType.MapNpc || ((Recruit)character).Belly > 0) || (HasAbility(character, "Toxic Boost") && HasAbility(character, "Immunity"))) {

                            } else {
                                h -= (100 * character.StatusAilmentCounter);
                            }
                        }
                        if (character.HasActiveItem(298) && (character.CharacterType == Enums.CharacterType.MapNpc || ((Recruit)character).Belly > 0)) {//heal ribbon
                            h += 150;
                        }
                        if (HasActiveBagItem(character, 12, 0, 0) && (character.CharacterType == Enums.CharacterType.MapNpc || ((Recruit)character).Belly > 0)) {//heal ribbon
                            h += 150;
                        }
                        if (character.HasActiveItem(154)) {
                            if (character.Type1 == Enums.PokemonType.Poison || character.Type2 == Enums.PokemonType.Poison) {
                                h += 50;
                            } else {
                                h -= 100;
                            }
                        }

                        if (h != 0) {
                            if (character.CharacterType == Enums.CharacterType.Recruit && character.HasActiveItem(298) && newHP < character.MaxHP && ((character.MaxHP + character.HPRemainder) * h / 4000) > 0) {
                                if (((Recruit)character).Owner.Player.Map.HungerEnabled) {
                                    ((Recruit)character).Owner.Player.BellyStepCounter += 20;
                                }
                            }
                            if (h > 0 && character.VolatileStatus.GetStatus("HealBlock") != null) {

                            } else {
                                newHP += ((character.MaxHP + character.HPRemainder) * h / 4000);
                            }
                            int newRemainder = ((character.MaxHP + character.HPRemainder) % 40);
                            character.HPRemainder = newRemainder;

                        }

                        if (newHP > character.MaxHP) {
                            newHP = character.MaxHP;
                        }

                        if (newHP != character.HP) {
                            if (character.CharacterType == Enums.CharacterType.Recruit) {

                                if (newHP <= 0) {
                                    hitlist.AddPacketToMap(map, PacketBuilder.CreateChatMsg("Oh, no!  " + character.Name + " fainted!", Text.BrightRed));
                                    OnDeath(((Recruit)character).Owner, Enums.KillType.Other);
                                } else {
                                    ((Recruit)character).Owner.Player.SetHP(newHP);
                                }
                            } else {

                                if (newHP <= 0) {
                                    OnNpcDeath(hitlist, null, (MapNpc)character);
                                    //((MapNpc)character).Num = 0;
                                    //((MapNpc)character).HP = 0;
                                    MapManager.RetrieveActiveMap(character.MapID).ActiveNpc[((MapNpc)character).MapSlot] = new MapNpc(character.MapID, ((MapNpc)character).MapSlot);

                                    hitlist.AddPacketToMap(map, TcpPacket.CreatePacket("npcdead", ((MapNpc)character).MapSlot));
                                } else {
                                    character.HP = newHP;
                                }
                            }

                        }

                        if ((character.CharacterType == Enums.CharacterType.MapNpc || ((Recruit)character).Belly > 0) && character.VolatileStatus.GetStatus("AquaRing") != null) {
                            int heal = character.MaxHP / 32;
                            if (heal < 1) heal = 1;
                            hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s health is restored by Aqua Ring!", Text.BrightGreen), character.X, character.Y, 10);
                            HealCharacter(character, map, heal, hitlist);
                        }

                        //if (character.VolatileStatus.GetStatus("LeechSeed:0") != null && !HasAbility(character, "Magic Guard")) {
                        //    int seeddmg = character.MaxHP / 32;
                        //    if (seeddmg < 1) seeddmg = 1;
                        //    int heal = 5;
                        //    if (character.VolatileStatus.GetStatus("LeechSeed:0").Target.HasActiveItem(194)) heal = 6;
                        //    hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s health is sapped by Leech Seed!", Text.BrightRed), character.X, character.Y, 10);
                        //    DamageCharacter(character, map, seeddmg, Enums.KillType.Other, hitlist, true);
                        //    if (HasAbility(character, "Liquid Ooze")) {
                        //        hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.VolatileStatus.GetStatus("LeechSeed:0").Target.Name + " sucked up the Liquid Ooze!", Text.BrightRed), character.X, character.Y, 10);
                        //        DamageCharacter(character.VolatileStatus.GetStatus("LeechSeed:0").Target, MapManager.RetrieveActiveMap(character.VolatileStatus.GetStatus("LeechSeed:0").Target.MapID), seeddmg, Enums.KillType.Other, hitlist, true);
                        //    } else {
                        //        HealCharacter(character.VolatileStatus.GetStatus("LeechSeed:0").Target, MapManager.RetrieveActiveMap(character.VolatileStatus.GetStatus("LeechSeed:0").Target.MapID), seeddmg * heal / 5, hitlist);
                        //    }
                        //}

                    }
                    status = character.VolatileStatus.GetStatus("Confusion");
                    if (status != null) {
                        status.Counter--;
                        if (status.Counter <= 0) {
                            RemoveExtraStatus(character, map, "Confusion", hitlist);
                        }
                    }
                    status = character.VolatileStatus.GetStatus("Invisible");
                    if (status != null) {
                        status.Counter--;
                        if (status.Counter <= 0) {
                            RemoveExtraStatus(character, map, "Invisible", hitlist);
                        }
                    }
                    status = character.VolatileStatus.GetStatus("Blind");
                    if (status != null) {
                        status.Counter--;
                        if (status.Counter <= 0) {
                            RemoveExtraStatus(character, map, "Blind", hitlist);
                        }
                    }
                    status = character.VolatileStatus.GetStatus("Shocker");
                    if (status != null) {
                        status.Counter--;
                        if (status.Counter <= 0) {
                            RemoveExtraStatus(character, map, "Shocker", hitlist);
                        }
                    }

                    //if (character.CharacterType == Enums.CharacterType.Recruit) {
                    //    if (((Recruit)character).Owner.Player.Confusion != 0) {
                    //        ((Recruit)character).Owner.Player.Confusion--;
                    //        if (((Recruit)character).Owner.Player.Confusion <= 0) {
                    //            ((Recruit)character).Owner.Player.Confusion = 1;
                    //            if (!CheckStatusProtection(character, map, "Confusion:0", false, hitlist)) {
                    //                Confuse(character, map, 0, hitlist);
                    //            }
                    //        }
                    //    }
                    //} else {
                    //    if (((MapNpc)character).Confused != 0) {
                    //        ((MapNpc)character).Confused--;
                    //        if (((MapNpc)character).Confused <= 0) {
                    //            ((MapNpc)character).Confused = 1;
                    //            if (!CheckStatusProtection(character, map, "Confusion:0", false, hitlist)) {
                    //                Confuse(character, map, 0, hitlist);
                    //            }
                    //        }
                    //    }
                    //}

                    if (character.CharacterType == Enums.CharacterType.Recruit) {
                        ((Recruit)character).Owner.Player.ProcessHunger(hitlist);
                    }

                    if (character.CharacterType == Enums.CharacterType.Recruit) {
                        Client clientOwner = ((Recruit)character).Owner;
                        StoryHelper.OnStep(clientOwner, hitlist);
                        if (stepCounter % 10 == 0) {
                            EggStep(clientOwner);
                        }

                    }
                }
                PacketHitList.MethodEnded(ref hitlist);

            } catch (Exception ex) {
                Messenger.AdminMsg("Error: OnStep", Text.Black);
            }
        }
Пример #15
0
        private static void Sticky(ICharacter character, IMap map, PacketHitList hitlist)
        {
            PacketHitList.MethodStart(ref hitlist);
            if (character.HasActiveItem(421)) {
                hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s No-Stick Cap prevented any items from becoming sticky!", Text.WhiteSmoke), character.X, character.Y, 10);
            } else {

                if (character.CharacterType == Enums.CharacterType.Recruit) {
                    Client client = ((Recruit)character).Owner;
                    List<int> itemsToCheck = new List<int>();
                    for (int i = 1; i <= client.Player.MaxInv; i++) {
                        if (client.Player.Inventory[i].Num > 0 && !client.Player.Inventory[i].Sticky) {
                            itemsToCheck.Add(i);
                        }
                    }
                    if (itemsToCheck.Count > 0) {
                        int stickySlot = itemsToCheck[Server.Math.Rand(0, itemsToCheck.Count)];
                        if (client.Player.Inventory[stickySlot].Num > 0 && !client.Player.Inventory[stickySlot].Sticky) {
                            client.Player.SetItemSticky(stickySlot, true);
                            hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s " + ItemManager.Items[client.Player.Inventory[stickySlot].Num].Name + " became sticky!", Text.BrightRed), character.X, character.Y, 10);
                        } else {
                            hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg("Nothing particularly bad happened to " + character.Name + "...", Text.Blue), character.X, character.Y, 10);
                        }
                    } else {
                        hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg("Nothing particularly bad happened to " + character.Name + "...", Text.Blue), character.X, character.Y, 10);
                    }
                } else if (character.CharacterType == Enums.CharacterType.MapNpc) {
                    MapNpc npc = character as MapNpc;
                    if (npc.HeldItem != null && !npc.HeldItem.Sticky) {
                        npc.HeldItem.Sticky = true;
                        if (npc.ActiveItems.Contains(npc.HeldItem.Num)) {
                            npc.RemoveFromActiveItemList(npc.HeldItem.Num);
                        }
                        hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg(character.Name + "'s " + ItemManager.Items[npc.HeldItem.Num].Name + " became sticky!", Text.BrightRed), character.X, character.Y, 10);
                    } else {
                        hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg("Nothing particularly bad happened to " + character.Name + "...", Text.Blue), character.X, character.Y, 10);
                    }
                }
            }
            PacketHitList.MethodEnded(ref hitlist);
        }