Guest User

Untitled

a guest
May 25th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.07 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using DOL.GS.PacketHandler;
  6.  
  7. namespace DOL.GS
  8. {
  9.     //238
  10.     public class RvRTeleporter : GameNPC
  11.     {
  12.         public override bool Interact(GamePlayer player)
  13.         {
  14.             if (!(base.Interact(player)))
  15.                 return false;
  16.  
  17.             //IF THEY ARE IN THE RVR REGION.
  18.             if (player.CurrentRegionID == 238)
  19.             {
  20.                 //Here we can offer individual ports to specific realms.
  21.                 switch (player.Realm)
  22.                 {
  23.                     case eRealm.Albion:
  24.                         {
  25.                             //Offer Albion Ports here.
  26.                             player.Out.SendMessage("I can return you to [Setup].", eChatType.CT_Say, eChatLoc.CL_PopupWindow);
  27.                         }
  28.                         break;
  29.                     case eRealm.Hibernia:
  30.                         {
  31.                             //Offer Hibernia Ports here.
  32.                             player.Out.SendMessage("I can return you to [Setup].", eChatType.CT_Say, eChatLoc.CL_PopupWindow);
  33.                         }
  34.                         break;
  35.                     case eRealm.Midgard:
  36.                         {
  37.                             //Offer Midgard Ports here.
  38.                             player.Out.SendMessage("I can return you to [Setup].", eChatType.CT_Say, eChatLoc.CL_PopupWindow);
  39.                         }
  40.                         break;
  41.                 }
  42.  
  43.                 return true;
  44.             }
  45.  
  46.             //IF NOT IN RVR REGION, WE OFFER TO PORT THEM THERE.
  47.             player.Out.SendMessage("I Can teleport you to your [Portal Keep]?", eChatType.CT_Say, eChatLoc.CL_PopupWindow);
  48.  
  49.             return true;
  50.         }
  51.         public override bool WhisperReceive(GameLiving source, string text)
  52.         {
  53.             if (!(base.WhisperReceive(source, text)))
  54.                 return false;
  55.  
  56.             //we only talk to players.
  57.             if (!(source is GamePlayer))
  58.                 return false;
  59.  
  60.             GamePlayer player = source as GamePlayer;
  61.  
  62.             //We don't allow them to port in combat.
  63.             if (player.InCombat)
  64.             {
  65.                 //privately tell them we won't help them while their in combat.
  66.                 player.WhisperReceive(this, "I will not help you escape defeat!");
  67.                 return false;
  68.             }
  69.  
  70.  
  71.             //we check what they player clicked on. It will always make all text lowercase.
  72.             switch (text.ToLower())
  73.             {
  74.                     //move the player to the portal keep.
  75.                 case "portal keep":
  76.                     {
  77.                         player.MoveTo(238, 1, 1, 1, 1);
  78.                     }
  79.                     break;
  80.                     //move the player to the setup zone.
  81.                 case "setup":
  82.                     {
  83.                         player.MoveTo(1, 1, 1, 1, 1);
  84.                     }
  85.                     break;
  86.             }
  87.  
  88.             return true;
  89.         }
  90.     }
  91. }
Add Comment
Please, Sign In to add comment