Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using DOL.GS.PacketHandler;
- namespace DOL.GS
- {
- //238
- public class RvRTeleporter : GameNPC
- {
- public override bool Interact(GamePlayer player)
- {
- if (!(base.Interact(player)))
- return false;
- //IF THEY ARE IN THE RVR REGION.
- if (player.CurrentRegionID == 238)
- {
- //Here we can offer individual ports to specific realms.
- switch (player.Realm)
- {
- case eRealm.Albion:
- {
- //Offer Albion Ports here.
- player.Out.SendMessage("I can return you to [Setup].", eChatType.CT_Say, eChatLoc.CL_PopupWindow);
- }
- break;
- case eRealm.Hibernia:
- {
- //Offer Hibernia Ports here.
- player.Out.SendMessage("I can return you to [Setup].", eChatType.CT_Say, eChatLoc.CL_PopupWindow);
- }
- break;
- case eRealm.Midgard:
- {
- //Offer Midgard Ports here.
- player.Out.SendMessage("I can return you to [Setup].", eChatType.CT_Say, eChatLoc.CL_PopupWindow);
- }
- break;
- }
- return true;
- }
- //IF NOT IN RVR REGION, WE OFFER TO PORT THEM THERE.
- player.Out.SendMessage("I Can teleport you to your [Portal Keep]?", eChatType.CT_Say, eChatLoc.CL_PopupWindow);
- return true;
- }
- public override bool WhisperReceive(GameLiving source, string text)
- {
- if (!(base.WhisperReceive(source, text)))
- return false;
- //we only talk to players.
- if (!(source is GamePlayer))
- return false;
- GamePlayer player = source as GamePlayer;
- //We don't allow them to port in combat.
- if (player.InCombat)
- {
- //privately tell them we won't help them while their in combat.
- player.WhisperReceive(this, "I will not help you escape defeat!");
- return false;
- }
- //we check what they player clicked on. It will always make all text lowercase.
- switch (text.ToLower())
- {
- //move the player to the portal keep.
- case "portal keep":
- {
- player.MoveTo(238, 1, 1, 1, 1);
- }
- break;
- //move the player to the setup zone.
- case "setup":
- {
- player.MoveTo(1, 1, 1, 1, 1);
- }
- break;
- }
- return true;
- }
- }
- }
Add Comment
Please, Sign In to add comment