Пример #1
0
        public override bool WhisperReceive(GameLiving source, string str)
        {
            if (!base.WhisperReceive(source, str))
            {
                return(false);
            }
            if (!(source is GamePlayer))
            {
                return(false);
            }
            GamePlayer player = (GamePlayer)source;

            TurnTo(player.X, player.Y);
            ClearChat(player);
            if (player.InCombat)
            {
                return(false);
            }
            List <GameNPC> npcs = WorldMgr.GetNPCsByGuild(str, eRealm.None);

            if (npcs.Count != 0)
            {
                foreach (GameNPC portto in npcs)
                {
                    msg += "[" + portto.Name + "]\n";
                }
                SayTo(player, msg);
            }
            else
            {
                GameNPC[] npctoportto = WorldMgr.GetNPCsByName(str, eRealm.None);
                GameNPC   portnow     = null;
                foreach (GameNPC np in npctoportto)
                {
                    if (np.GuildName == this.GuildName)
                    {
                        portnow = np;
                    }
                }
                if (portnow != null)
                {
                    if (player.Group != null)
                    {
                        foreach (GamePlayer grupee in player.Group.GetPlayersInTheGroup())
                        {
                            grupee.Out.SendMessage(player.Name + " has ported to " + portnow.Name, eChatType.CT_Group, eChatLoc.CL_ChatWindow);
                        }
                    }
                    player.MoveTo(portnow.CurrentRegionID, portnow.X, portnow.Y, portnow.Z, portnow.Heading);
                    npcs = null;
                    return(true);
                }
            }
            msg = "";


            return(true);
        }
Пример #2
0
        public override bool Interact(GamePlayer player)
        {
            if (base.Interact(player))
            {
                msg = "Hello, which morph do you wish to morph in to? \n";
                ClearChat(player);

                if (cachedMorphList == null)
                {
                    cachedMorphList = new Dictionary <int, List <string> >(); // RR required and list of mob names

                    List <GameNPC> morphs = WorldMgr.GetNPCsByGuild("Morphs", eRealm.None);
                    foreach (GameNPC morph in morphs)
                    {
                        List <string> names = new List <string>();
                        if (cachedMorphList.ContainsKey(morph.Level))
                        {
                            names = cachedMorphList[morph.Level];
                            cachedMorphList.Remove(morph.Level);
                        }
                        names.Add(morph.Name);

                        // int rr = ((int)morph.Level) + 10;
                        int rr = morph.Level;
                        cachedMorphList.Add(morph.Level, names);
                    }
                }
                foreach (KeyValuePair <int, List <string> > kvp in cachedMorphList)
                {
                    if (player.RealmLevel >= kvp.Key)
                    {
                        //130 = 130 / 10 = 13
                        //70 = 70 / 10 = 7..

                        //135 = 135 % 10 = 5.. 135 - 5 = 130.. / 10 = 13

                        //76 = 76 % 10  = 6... 76 - 66 = 70 / 10 = 7
                        string RR;
                        int    partTwo = (kvp.Key % 10);

                        int partOne = (kvp.Key - partTwo) / 10;

                        RR   = partOne.ToString() + "L" + partTwo.ToString();
                        msg += "[RR" + RR + "]" + "\n";
                    }
                }
                SendReply(player, msg);
            }
            msg = "Hello, where do you wish to port to? \n";
            return(true);
        }
Пример #3
0
        public override bool Interact(GamePlayer player)
        {
            if (base.Interact(player))
            {
                if (player.KillsLegion == 100)
                {
                    if (player.RealmLevel > 90)
                    {
                        player.RespecRealm();
                        player.RealmPoints          = 0;
                        player.RealmSpecialtyPoints = 0;
                        player.RealmLevel           = 0;
                        player.GainRealmPoints(5974125, false);

                        /*
                         * if (player.RealmSpecialtyPoints < 10)
                         * {
                         *  player.RealmSpecialtyPoints = 90;
                         * }
                         * if (player.RealmLevel < 10)
                         * {
                         *  player.RealmLevel = 90;
                         * }
                         */
                        player.Out.SendMessage("Greetings, we have reset everyones realm rank to RR10 if you was above realm rank 10, this should not happen again as the RP rate has been lowered drastically", eChatType.CT_Spell, eChatLoc.CL_ChatWindow);
                        player.KillsLegion = 0;
                        player.SaveIntoDatabase();
                    }
                }

                SayTo(player, string.Format("Hello {0}, where do you wish to teleport?\n\n \n [PvP Zone] or [Setup] or See the PvP [Voting] options.", player.Name));
                List <GameNPC> pvpSetupMarkers = WorldMgr.GetNPCsByGuild("PvP Setup", eRealm.None);
                if (pvpSetupMarkers.Count > 0)
                {
                    string GMstr = "FORCE Change the PvP Zone ? ";
                    GMstr += GetAllPorts(false);
                    GMstr += "[Change] to whichever zone has the highest number of votes";
                    if (player.Client.Account.PrivLevel > 2)
                    {
                        SayTo(player, GMstr);
                    }
                }
                return(true);
            }
            return(false);
        }
Пример #4
0
        public string GetAllPorts(bool addAmounts)
        {
            string         str             = "";
            List <GameNPC> pvpSetupMarkers = WorldMgr.GetNPCsByGuild("PvP Setup", eRealm.None);

            if (pvpSetupMarkers.Count > 0)
            {
                foreach (GameNPC npc in pvpSetupMarkers)
                {
                    if (addAmounts)
                    {
                        str += "(" + PvPHandler.NumberOfVotes(npc.Name) + " Votes)";
                    }
                    str += " [" + npc.Name + "]\n";
                }
            }
            return(str);
        }
Пример #5
0
        public override bool Interact(GamePlayer player)
        {
            if (base.Interact(player))
            {
                ClearChat(player);
                if (player.KillsLegion == 100)
                {
                    if (player.RealmLevel > 90)
                    {
                        player.RespecRealm();
                        player.RealmPoints          = 0;
                        player.RealmSpecialtyPoints = 0;
                        player.RealmLevel           = 0;
                        player.GainRealmPoints(5974125, false);

                        /*
                         * if (player.RealmSpecialtyPoints < 10)
                         * {
                         *  player.RealmSpecialtyPoints = 90;
                         * }
                         * if (player.RealmLevel < 10)
                         * {
                         *  player.RealmLevel = 90;
                         * }
                         */
                        player.Out.SendMessage("Greetings, we have reset everyones realm rank to RR10 if you was above realm rank 10, this should not happen again as the RP rate has been lowered drastically", eChatType.CT_Spell, eChatLoc.CL_ChatWindow);
                        player.KillsLegion = 0;
                        player.SaveIntoDatabase();
                    }
                }

                List <GameNPC> npcs = WorldMgr.GetNPCsByGuild(this.GuildName, eRealm.None);
                foreach (GameNPC port in npcs)
                {
                    if (port.Name != this.Name)
                    {
                        msg += "[" + port.Name + "]\n";
                    }
                }
                SayTo(player, msg);
            }
            msg = "Hello, where do you wish to port to? \n";
            return(true);
        }
Пример #6
0
        public override bool WhisperReceive(GameLiving source, string str)
        {
            if (!base.WhisperReceive(source, str))
            {
                return(false);
            }
            if (!(source is GamePlayer))
            {
                return(false);
            }
            GamePlayer player = (GamePlayer)source;

            TurnTo(player.X, player.Y);
            ClearChat(player);
            msg = "Hello, which morph do you wish to morph in to? \n";
            if (str == "Reload")
            {
                cachedMorphList = new Dictionary <int, List <string> >(); // RR required and list of mob names

                List <GameNPC> morphs = WorldMgr.GetNPCsByGuild("Morphs", eRealm.None);
                foreach (GameNPC morph in morphs)
                {
                    List <string> names = new List <string>();
                    if (cachedMorphList.ContainsKey(morph.Level))
                    {
                        names = cachedMorphList[morph.Level];
                        cachedMorphList.Remove(morph.Level);
                    }
                    names.Add(morph.Name);

                    cachedMorphList.Add(morph.Level, names);
                }
            }
            if (str.Contains("RR"))
            {
                int rr = int.Parse(str.Replace("RR", "").Replace("L", ""));
                if (cachedMorphList.ContainsKey(rr))
                {
                    List <string> npcs = cachedMorphList[rr];
                    foreach (string mobName in npcs)
                    {
                        msg += "[" + mobName + "]\n";
                    }
                    SendReply(player, msg);
                }
            }
            else
            {
                GameNPC[] npcs = WorldMgr.GetNPCsByName(str, eRealm.None);
                if (npcs != null)
                {
                    if (player.RealmLevel >= npcs[0].Level)
                    {
                        player.Model = npcs[0].Model;
                        player.SaveIntoDatabase();
                    }
                }
            }
            msg = "";


            return(true);
        }