Exemplo n.º 1
0
        public override bool WhisperReceive(GameLiving source, string str)
        {
            if (base.WhisperReceive(source, str))
            {
                GamePlayer player = source as GamePlayer;
                if (player == null || player.InCombat)
                {
                    return(false);
                }

                if (GameServer.ServerRules.IsSameRealm(this, player, true))
                {
                    switch (str.ToLower())
                    {
                    case "movement":
                        if (!player.CurrentRegion.IsRvR || player.Realm == Realm)
                        {
                            GameNPCHelper.CastSpellOnOwnerAndPets(this, player, SkillBase.GetSpellByID(GameHastener.SPEEDOFTHEREALMID), SkillBase.GetSpellLine(GlobalSpellsLines.Mob_Spells), false);
                        }

                        break;

                    case "strength":
                        if (player.CurrentRegion.IsCapitalCity)
                        {
                            TargetObject = player;
                            CastSpell(SkillBase.GetSpellByID(STROFTHEREALMID), SkillBase.GetSpellLine(GlobalSpellsLines.Mob_Spells), false);
                        }

                        break;

                    case "borderkeep":
                        if ((player.CurrentRegion.IsCapitalCity || IsShroudedIslesStartZone(player.CurrentZone.ID)) && player.Level < 10)
                        {
                            if (!ServerProperties.Properties.BG_ZONES_OPENED && player.Client.Account.PrivLevel == (uint)ePrivLevel.Player)
                            {
                                SayTo(player, ServerProperties.Properties.BG_ZONES_CLOSED_MESSAGE);
                            }
                            else
                            {
                                AbstractGameKeep portalKeep = GameServer.KeepManager.GetBGPK(player);
                                if (portalKeep != null)
                                {
                                    player.MoveTo((ushort)portalKeep.Region, portalKeep.X, portalKeep.Y, portalKeep.Z, (ushort)portalKeep.Heading);
                                }
                            }
                        }

                        break;
                    }
                }

                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        public override bool Interact(GamePlayer player)
        {
            if (player == null || player.InCombat)
            {
                return(false);
            }

            if (!base.Interact(player))
            {
                return(false);
            }

            // just give out speed without asking
            GameNPCHelper.CastSpellOnOwnerAndPets(this, player, SkillBase.GetSpellByID(GameHastener.SPEEDOFTHEREALMID), SkillBase.GetSpellLine(GlobalSpellsLines.Mob_Spells), false);

            if (player.CurrentRegion.IsCapitalCity)
            {
                SayTo(player, string.Format(
                          "{0} {1}. {2} {3} {4}",
                          LanguageMgr.GetTranslation(player.Client.Account.Language, "GameHastener.Greeting"),
                          player.CharacterClass.Name,
                          LanguageMgr.GetTranslation(player.Client.Account.Language, "GameHastener.CityMovementOffer"),
                          LanguageMgr.GetTranslation(player.Client.Account.Language, "GameHastener.StrengthOffer"),
                          LanguageMgr.GetTranslation(player.Client.Account.Language, "GameHastener.BorderKeepPortOffer")));
            }
            else if (IsShroudedIslesStartZone(player.CurrentZone.ID))
            {
                SayTo(player, string.Format(
                          "{0} {1}. {2} {3}",
                          LanguageMgr.GetTranslation(player.Client.Account.Language, "GameHastener.Greeting"),
                          player.CharacterClass.Name,
                          LanguageMgr.GetTranslation(player.Client.Account.Language, "GameHastener.CityMovementOffer"),
                          LanguageMgr.GetTranslation(player.Client.Account.Language, "GameHastener.BorderKeepPortOffer")));
            }
            else if (!player.CurrentRegion.IsRvR) // default message outside of RvR
            {
                SayTo(player, string.Format(
                          "{0} {1}. {2}",
                          LanguageMgr.GetTranslation(player.Client.Account.Language, "GameHastener.Greeting"),
                          player.CharacterClass.Name,
                          LanguageMgr.GetTranslation(player.Client.Account.Language, "GameHastener.DefaultMovementOffer")));
            }

            return(true);
        }