Exemplo n.º 1
0
        /// <summary>
        /// Interact with the NPC.
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        public override bool Interact(GamePlayer player)
        {
            if (!base.Interact(player) || player == null)
            {
                return(false);
            }

            if (GlobalConstants.IsExpansionEnabled((int)eClientExpansion.DarknessRising))
            {
                if (player.CurrentRegion.Expansion == (int)eClientExpansion.DarknessRising)
                {
                    SayTo(player, "Do you wish to [exit]?");
                }
                else
                {
                    SayTo(player, "Do you require an audience with the [King]?");
                }
                return(true);
            }
            else
            {
                String reply = "I am afraid, but the King is busy right now.";

                if (player.Inventory.CountItemTemplate("Personal_Bind_Recall_Stone", eInventorySlot.Min_Inv, eInventorySlot.Max_Inv) == 0)
                {
                    reply += " If you're only here to get your Personal Bind Recall Stone then I'll see what I can [do].";
                }

                SayTo(player, reply);
                return(false);
            }
        }
        /// <summary>
        /// Interact with the NPC.
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        public override bool Interact(GamePlayer player)
        {
            if (!base.Interact(player) || player == null)
            {
                return(false);
            }

            if (GlobalConstants.IsExpansionEnabled((int)eClientExpansion.DarknessRising))
            {
                SayTo(player, "Let me check to see if you are owed any items ... ");

                if (player.Inventory.CountItemTemplate("Personal_Bind_Recall_Stone", eInventorySlot.Min_Inv, eInventorySlot.Max_Inv) == 0)
                {
                    SayTo(player, "I see you are missing your Personal Bind Recall Stone.  Would you like [another]?");
                }

                return(true);
            }

            return(false);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Talk to the NPC.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="str"></param>
        /// <returns></returns>
        public override bool WhisperReceive(GameLiving source, string text)
        {
            if (!base.WhisperReceive(source, text) || !(source is GamePlayer))
            {
                return(false);
            }

            GamePlayer player = source as GamePlayer;

            if ((text.ToLower() == "king" || text.ToLower() == "exit") && GlobalConstants.IsExpansionEnabled((int)eClientExpansion.DarknessRising))
            {
                uint   throneRegionID   = 0;
                string teleportThroneID = "error";
                string teleportExitID   = "error";

                switch (Realm)
                {
                case eRealm.Albion:
                    throneRegionID   = 394;
                    teleportThroneID = "AlbThroneRoom";
                    teleportExitID   = "AlbThroneExit";
                    break;

                case eRealm.Midgard:
                    throneRegionID   = 360;
                    teleportThroneID = "MidThroneRoom";
                    teleportExitID   = "MidThroneExit";
                    break;

                case eRealm.Hibernia:
                    throneRegionID   = 395;
                    teleportThroneID = "HibThroneRoom";
                    teleportExitID   = "HibThroneExit";
                    break;
                }

                if (throneRegionID == 0)
                {
                    log.ErrorFormat("Can't find King for player {0} speaking to {1} of realm {2}!", player.Name, Name, Realm);
                    player.Out.SendMessage("Server error, can't find throne room.", DOL.GS.PacketHandler.eChatType.CT_Staff, DOL.GS.PacketHandler.eChatLoc.CL_SystemWindow);
                    return(false);
                }

                Teleport teleport = null;

                if (player.CurrentRegionID == throneRegionID)
                {
                    teleport = GameServer.Database.SelectObjects <Teleport>("`TeleportID` = @TeleportID", new QueryParameter("@TeleportID", teleportExitID)).FirstOrDefault();
                    if (teleport == null)
                    {
                        log.ErrorFormat("Can't find throne room exit TeleportID {0}!", teleportExitID);
                        player.Out.SendMessage("Server error, can't find exit to this throne room.  Moving you to your last bind point.", DOL.GS.PacketHandler.eChatType.CT_Staff, DOL.GS.PacketHandler.eChatLoc.CL_SystemWindow);
                        player.MoveToBind();
                    }
                }
                else
                {
                    teleport = GameServer.Database.SelectObjects <Teleport>("`TeleportID` = @TeleportID", new QueryParameter("@TeleportID", teleportThroneID)).FirstOrDefault();
                    if (teleport == null)
                    {
                        log.ErrorFormat("Can't find throne room TeleportID {0}!", teleportThroneID);
                        player.Out.SendMessage("Server error, can't find throne room teleport location.", DOL.GS.PacketHandler.eChatType.CT_Staff, DOL.GS.PacketHandler.eChatLoc.CL_SystemWindow);
                    }
                }

                if (teleport != null)
                {
                    SayTo(player, "Very well ...");
                    player.MoveTo((ushort)teleport.RegionID, teleport.X, teleport.Y, teleport.Z, (ushort)teleport.Heading);
                }

                return(true);
            }


            if (text.ToLower() == "do")
            {
                if (player.Inventory.CountItemTemplate("Personal_Bind_Recall_Stone", eInventorySlot.Min_Inv, eInventorySlot.Max_Inv) == 0)
                {
                    SayTo(player, "Very well then. Here's your Personal Bind Recall Stone, may it serve you well.");
                    player.ReceiveItem(this, "Personal_Bind_Recall_Stone");
                }
                return(false);
            }

            return(true);
        }