Advertisement
Guest User

Waypoint Code 1.9.9

a guest
Apr 3rd, 2013
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 118.18 KB | None | 0 0
  1. #####################################################################################################################################################
  2. #####################################################################################################################################################
  3. ### FILE NAME           : global_player.pl
  4. ### VERSION             : 1.9.9
  5. ### UPDATED             : April 3, 2013
  6. ### QUEST               : Create Solo, Raid, and Guild instances with custom invites
  7. ### REQURIED PLUGIN 1   : globals.pl (plugin::var, plugin::val) for subs to get variable values (Might copy plugins to a sub later)
  8. ### REQURIED PLUGIN 2   : check_hasitem.pl (plugin::check_hasitem) to determine prices via item
  9. ### ITEM IDS            : 119998 = Waypoint, 120003 = Free Waypoint
  10. ### QGLOBAL VARIABLE    : XXX = Instance ID, YYY = Auto Increment ID
  11. ### QGLOBAL SOLO        : $name_SoloI_$zonesn_$zoneid, $name_RaidI_DELETE_$zonesn_$zoneid, RaidI_Group_$RAIDGROUPID_$zonesn_$zoneid
  12. ### QGLOBAL RAID        : $name_RaidI_$zonesn_$zoneid, XXX_RaidI_Leader, XXX__RaidI_Time, XXX_RaidI_$zonesn_$zoneid, XXX_RaidI_Status_YYY
  13. ### QGLOBAL GUILD       : GuildI_$uguild_ID_$zonesn_$zoneid, XXX_GuildI_$zonesn_$zoneid, XXX_GuildI_Leader,
  14. ###                       XXX__GuildI_Time, XXX_GuildI_$zonesn_$zoneid, XXX_GuildI_Status_YYY
  15. ### QGLOBAL SPAM DELAY  : SPAM_SoloI_$name_$zonesn_$zoneid, SPAM_GuildI_$uguild_id_$zonesn_$zoneid, SPAM_RaidI_$name_$zonesn_$zoneid (600 seconds to re-create instances)
  16. ###
  17. ### Special Thanks      : Used code from Bamron, Hateborne, Natedog, Crab, Trevius, Akkadius, Secrets, and a few other people
  18. ###
  19. ### STUFF TO DO         :
  20. ###                       Add: Time Remaining of instance on Popup window info when creating instance
  21. ###                       Edit: change syntax to have symbol ("#" or ".") in front of commands
  22. ###                       Maybe Use: my $GuildName = $client->GuildID(); my $GuildName = quest::getguildnamebyid($guildID);
  23. ###                       Maybe Use: my $RaidGroup = $client->GetRaid(); my $raidID = $RaidGroup->GetID();
  24. ###                       Add: One command from leader to invite/teleport entire guild/raid into the instance
  25. ###
  26. ### OTHER NOTES         : This code was revamped to use DBI for reading QGlobals
  27. ###
  28. ### CHANGES             :
  29. ###                         04/03/2013
  30. ###                         Added anti spam at top of sub EVENT_SAY
  31. ###                         Added Raid Group Members allowed to Raid List
  32. ###                         Added / Changed Solo Instance to Group Instance
  33. ###                         Added / Changed Raid Instance to automatically allow members of raid group to join
  34. ###                         Changed Hunter_Raid_cshome_26 to Hunter_RaidI_cshome_26
  35. ###                         Changed Hunter_Guild_cshome_26 to Hunter_GuildI_cshome_26
  36. ###                         Changed SPAM_RAID_cshome_Hunter to SPAM_RaidI_cshome_Hunter
  37. ###                         Changed SPAM_GUILD_cshome_Hunter to SPAM_GuildI_cshome_Hunter
  38. ###                         Changed 5_Guild_cshome_26 to 5_GuildI_cshome_26
  39. ###                         Changed solo to SoloI
  40. ###                         Prices adjusted (lowered)
  41. ###
  42. ###                         04/02/2013
  43. ###                         Changed SPAM_GUILD_$zonesn_$name to SPAM_GUILD_$zonesn_$uguild_id to prevent other members from re-create
  44. ###                         Changed method for getting user/password for DBI
  45. ###                         Prevent non-guilded players from making guild instance for id -1
  46. ###                         Fixed the ability to invite and remove players into an instance from ANY zone.
  47. ###                         Revamped to use DBI to read qglobals since zones don't always refresh memory
  48. ###                         Created function with DBI to check for expired qglobals
  49. ###                         Updated DBI for GM tools to read user name and password from config file
  50. ###                         Make instances all free for now to test new code
  51. ###                         Made commons and overthere (pvp zones) to be 999999999 cost as a way of disable instances from those zones
  52. ###                         Added quest::AssignToInstance(); to a few more locations
  53. ###
  54. ###                         04/01/2013
  55. ###                         Added ability to invite Raid/Guild members all on one line separated by comma
  56. ###                         Added GM commands to "find" and "goto" player which helps to find players and teleport to them in an intstance
  57. ###                         Added ListZoneSNToID2() for find and goto GM commands
  58. ###                         Added 15 minute delay to delete instances so that player don't delete instance before they can re-create it
  59. ###                         Updated Waypoint.pl for adding funds to account, but no menu or instances.
  60. ###
  61. ###                         03/31/2013
  62. ###                         Added Qglobal $name_Guild_$zonesn_$zoneid
  63. ###                         guild join and raid join now use <name> instead of <id>
  64. ###                         Player gets message of being BANNED when getting banned, or trying to join when banned
  65. ###                         Player gets message that you were not invited if trying to join before getting invited
  66. ###                         Added command Waypoint to bring up the menu in addition to Instance or Instances
  67. ###                         Added Spam Delay Global for Creating Instances in same zone and tell player how many seconds left to create again
  68. ###
  69. ###                         03/30/2013
  70. ###                         Changed menu system, put some commands under the "More Options" saylink to reduce menu size
  71. ###                         Changed instance durations from 14400 to 259200 (4 hrs to 72 hrs)
  72. ###                         Updated prices and per zone and per type
  73. ###                         Created sub zone id to zone name (Hope I didn't re-create something that already exist lol)
  74. ###                         Added $zoneid to $zonesn in qglobal name and passed to $signal, telling players in a different zone which zone to be used
  75. ###                         $signal remove - greater than 1000000000 (1 billion) = remove player from instance
  76. ###                         $signal zone id - has $zoneid * 1000000 (1 million) for $zoneid to pass through signal via int ($signal / 1000000)
  77. ###                         $signal instance id - has instance id passed by int ($signal % 1000000) to get the value under 1 million for instance id
  78. ###                         Updated signal to give message to player that was invited regardless of any status (pending, joined, removed)
  79. ###                         Added with the above update, players can re-invite players that did not receive the message or was zoning at the time, etc.
  80. ###                         Updated Popup window info when being invited, removed, or choosing to leave instance
  81. #####################################################################################################################################################
  82. #####################################################################################################################################################
  83.  
  84.  
  85. sub EVENT_SAY
  86. {
  87.  
  88. # Name of each spam
  89. my $time_delay_1 = "$name" . "SayDelay1";
  90. my $time_delay_2 = "$name" . "SayDelay2";
  91. my $time_delay_3 = "$name" . "SayDelay3";
  92. my $time_delay_4 = "$name" . "SayDelay4";
  93. my $time_delay_5 = "$name" . "SayDelay5";
  94.  
  95. # Check the spam queue, and fill if empty
  96. if      (!defined($qglobals{$time_delay_1}))    { quest::setglobal("$time_delay_1","SPAM1","1","S10"); } # All NPC, This Player, This Zone, 10 Seconds
  97. elsif   (!defined($qglobals{$time_delay_2}))    { quest::setglobal("$time_delay_2","SPAM2","1","S10"); } # All NPC, This Player, This Zone, 10 Seconds
  98. elsif   (!defined($qglobals{$time_delay_3}))    { quest::setglobal("$time_delay_3","SPAM3","1","S10"); } # All NPC, This Player, This Zone, 10 Seconds
  99. elsif   (!defined($qglobals{$time_delay_4}))    { quest::setglobal("$time_delay_4","SPAM4","1","S10"); } # All NPC, This Player, This Zone, 10 Seconds
  100. elsif   (!defined($qglobals{$time_delay_5}))    { quest::setglobal("$time_delay_5","SPAM5","1","S10"); } # All NPC, This Player, This Zone, 10 Seconds
  101. else
  102. {
  103.     $client->Message(15,"$name please slow down before you get banned!");
  104.     my $spam_name = "SPAM_COUNT_" . $name;
  105.     my $spam_count = 1 + $qglobals{$spam_name};
  106.     quest::setglobal("$spam_name","$spam_count","7","F"); # Keep record of spam count
  107. }
  108.  
  109. # If spam queue is not full, then allow say
  110. if (!defined($qglobals{$time_delay_1}) || !defined($qglobals{$time_delay_2}) ||
  111.     !defined($qglobals{$time_delay_3}) || !defined($qglobals{$time_delay_4}) ||
  112.     !defined($qglobals{$time_delay_5}))
  113. {
  114.  
  115.     ###############################################################################################
  116.     # START GM COMMAND ############################################################################
  117.     # Find if player is in an instance, other info, etc before trying to goto them
  118.     if ($text=~/^find/i && $status > 150)
  119.     {
  120.         my $lostperson = substr($text, 5);
  121.         FIND_PLAYER_INSTANCE($lostperson);
  122.     }
  123.     # Can goto player last known zone/instance and XYZ position via DBI and character_ table
  124.     # Useful for finding players when they belong to many instances
  125.     if ($text=~/^goto/i && $status > 150)
  126.     {
  127.         my $lostperson = substr($text, 5);
  128.         GOTO_PLAYER_INSTANCE($lostperson);
  129.     }
  130.     # END GM COMMAND ##############################################################################
  131.     ###############################################################################################
  132.  
  133.     my $SoloStatus      = 1;
  134.     my $GuildStatus     = 1;
  135.     my $RaidStatus      = 1;
  136.  
  137.     if ($text=~/^Instance$/i || $text=~/^Instances$/i || $text=~/^Waypoint$/i)
  138.     {
  139.         my $freeinstance = plugin::check_hasitem($client, 120003);  #EDIT item ID for FREE instance item
  140.         my $paidinstance = plugin::check_hasitem($client, 119998);  #EDIT item ID for PAID instance item
  141.         $client->Message(315," ");
  142.         if ($freeinstance)
  143.         {
  144.             $client->Message(315,"Free Waypoint Menu");
  145.             $client->Message(315,"------------------------------");
  146.         }
  147.         elsif ($paidinstance)
  148.         {
  149.             $client->Message(315,"Reglar Waypoint Menu");
  150.             $client->Message(315,"---------------------------------");
  151.         }
  152.         else
  153.         {
  154.             $client->Message(315,"Non Discount Waypoint Menu");
  155.             $client->Message(315,"-------------------------------------------");
  156.         }
  157.     }
  158.  
  159.     ###############################################################################################
  160.     ### START SOLO INSTANCES ######################################################################
  161.     if ($SoloStatus == 1)
  162.     {
  163.         if ($text=~/^Instance$/i || $text=~/^Instances$/i || $text=~/^Waypoint$/i)
  164.         {
  165.             my $SoloInstanceID  = "$name" . "_SoloI_" . "$zonesn" . "_" . "$zoneid";
  166.             if (GET_QGLOBAL_VALUE("$SoloInstanceID"))
  167.             {
  168.                 my $EnterSoloInstance = quest::saylink("Enter Solo", 1);
  169.                 my $DeleteSoloInstance = quest::saylink("Delete Solo", 1);
  170.                 $client->Message(315,"[$EnterSoloInstance] [$DeleteSoloInstance]");
  171.             }
  172.             else
  173.             {
  174.                 my $SoloCreate = quest::saylink("Create Solo Instance", 1);
  175.                 my $SoloCost = SOLO_PRICE();
  176.                 $client->Message(315,"[$SoloCreate] : $SoloCost Platinum");
  177.             }
  178.             $qglobals{"$SoloInstanceID"} = undef;
  179.         }
  180.  
  181.         if($text=~/^Create Solo Instance$/i)
  182.         {
  183.             my $SoloInstanceID  = "$name" . "_SoloI_" . "$zonesn" . "_" . "$zoneid";
  184.             if (GET_QGLOBAL_VALUE("$SoloInstanceID"))
  185.             {
  186.                 $client->Message(315,"You already have a Solo instance for $zonesn.");
  187.             }
  188.             else
  189.             {
  190.                 my $accountid = $client->AccountID();
  191.                 my $bankcredit = GET_QGLOBAL_VALUE("BankCredit_$accountid");
  192.                 my $SoloCost = SOLO_PRICE();
  193.                 my $cost = $SoloCost;
  194.                 my $SPAM_NAME = "SPAM_SoloI_" . $name . "_$zonesn" . "_$zoneid";
  195.                 my $SPAM_TIME = 600; # Make 3600 / 1 HR
  196.                 if ($bankcredit < $cost)
  197.                 {
  198.                     $client->Message(315,"You need ". ($cost - $bankcredit) . " more plat!");
  199.                 }
  200.                 elsif (GET_QGLOBAL_VALUE_EXPIRE("$SPAM_NAME"))
  201.                 {
  202.                     my $SPAM_VALUE  = GET_QGLOBAL_VALUE("$SPAM_NAME");
  203.                     my $TIME_LEFT   = $SPAM_TIME + $SPAM_VALUE - time();
  204.                     $client->Message(315,"You can create another Solo Instance in $TIME_LEFT seconds.");
  205.                 }
  206.                 else
  207.                 {
  208.                     quest::setglobal("$SPAM_NAME",time(),"7","S$SPAM_TIME"); # PREVENT CREATE SPAM FOR THIS ZONE
  209.                     PayInstance("BankCredit", $cost, "Solo Instance");
  210.                     my $InstVersion = 0;            # Must be 0 to load NPCs into an instance
  211.                     my $InstanceDuration = 259200;
  212.                     my $EnterSoloInstance = quest::saylink("Enter Solo", 1);
  213.                     my $InstID = quest::CreateInstance("$zonesn", $InstVersion, $InstanceDuration);
  214.                     quest::setglobal("$SoloInstanceID","$InstID","7","S$InstanceDuration");
  215.                     quest::AssignToInstance($InstID);
  216.                     $client->Message(315,"You created a solo instance ($InstID) for $zonesn.");
  217.                     my $ClientGroup = $client->GetGroup();
  218.                     if (defined($ClientGroup))
  219.                     {
  220.                         # $Group->GroupMessage($name, "type: /say solo join $name");                            # NOT WORKING?
  221.                         my $SoloGroupID = "$name" . "_SoloI_GroupID_" . "$zonesn" . "_" . "$zoneid";
  222.                         my $groupID = $ClientGroup->GetID();
  223.                         quest::setglobal("$SoloGroupID","$groupID","7","S$InstanceDuration");
  224.                         quest::AssignGroupToInstance($InstID);  # Add / Assign group to instance for when they join via solo join
  225.                         $client->Message(315,"Your group was added to solo instance ($InstID) for $zonesn.");
  226.                         $client->Message(315,"Tell your group to /say solo join $name");
  227.                         $qglobals{"$SoloGroupID"}  = undef;
  228.                     }
  229.                     $client->Message(315,"Would you like to $EnterSoloInstance instance?");
  230.                 } # create instance then send
  231.                 $qglobals{"$SPAM_NAME"}  = undef;
  232.             }
  233.             $qglobals{"$SoloInstanceID"} = undef;
  234.         }
  235.  
  236.         if($text=~/^Enter Solo$/i)
  237.         {
  238.             my $SoloInstanceID = "$name" . "_SoloI_" . "$zonesn" . "_" . "$zoneid";
  239.             if (GET_QGLOBAL_VALUE("$SoloInstanceID"))
  240.             {
  241.                 my $timestamp = localtime(time);
  242.                 my $InstID = GET_QGLOBAL_VALUE("$SoloInstanceID");
  243.                 my $Cx = $client->GetX();
  244.                 my $Cy = $client->GetY();
  245.                 my $Cz = $client->GetZ();
  246.                 quest::popup("ENTER SOLO INSTANCE","<br>
  247.                             <c \"#FE2E2E\">Moving you to SOLO instance!<br>
  248.                             <br>
  249.                             <c \"#FFFF49\">Time : &nbsp;&nbsp;&nbsp;<c \"#00FF00\">$timestamp<br>
  250.                             <c \"#FFFF49\">Name : &nbsp; <c \"#00FF00\">$name<br>
  251.                             <c \"#FFFF49\">Zone : &nbsp;&nbsp;&nbsp; <c \"#00FF00\">$zonesn<br>
  252.                             <c \"#FFFF49\">Type : &nbsp;&nbsp;&nbsp;&nbsp; <c \"#00FF00\">Solo<br>
  253.                             <br>
  254.                             <c \"#00BFFF\">ENJOY!<br>
  255.                             <br>
  256.                             <br>
  257.                             ",1050,0);
  258.                 $client->Message(315, " ");
  259.                 $client->Message(315, "Moving you to solo instance ($InstID) for $zonesn.");
  260.                 quest::AssignToInstance($InstID);
  261.                 quest::MovePCInstance($zoneid, $InstID, $Cx, $Cy, $Cz);
  262.             }
  263.             else
  264.             {
  265.                 $client->Message(315,"You do not have a solo instance for $zonesn.");
  266.             } # create instance then send
  267.             $qglobals{"$SoloInstanceID"} = undef;
  268.         }
  269.  
  270.  
  271.         ### JOIN SOLO INSTANCE ##################################################################
  272.         if($text=~/^solo join /i)
  273.         {
  274.             my $Check_S_Leader = substr($text, 10);
  275.             my $SoloInstanceID = "$Check_S_Leader" . "_SoloI_" . "$zonesn" . "_" . "$zoneid";
  276.             my $SoloGroupID = "$Check_S_Leader" . "_SoloI_GroupID_" . "$zonesn" . "_" . "$zoneid";
  277.  
  278.             my $ClientGroup = $client->GetGroup();
  279.             if (defined($ClientGroup))
  280.             {
  281.                 my $groupID = $ClientGroup->GetID();
  282.                 if ($groupID == GET_QGLOBAL_VALUE("$SoloGroupID"))
  283.                 {
  284.                     my $timestamp = localtime(time);
  285.                     my $InstID = GET_QGLOBAL_VALUE("$SoloInstanceID");
  286.                     my $Cx = $client->GetX();
  287.                     my $Cy = $client->GetY();
  288.                     my $Cz = $client->GetZ();
  289.                     $client->Message(315, "Moving you to $Check_S_Leader Solo (Group) Instance ($InstID) for $zonesn.");
  290.                     quest::MovePCInstance($zoneid, $InstID, $Cx, $Cy, $Cz);
  291.                 }
  292.                 else
  293.                 {
  294.                     $client->Message(315, "You do not belong to $Check_S_Leader Solo (Group) Instance for $zonesn.");
  295.                 }
  296.                 $qglobals{"$SoloGroupID"} = undef;
  297.                 $qglobals{"$SoloInstanceID"} = undef;
  298.             }
  299.             else
  300.             {
  301.                 $client->Message(315, "You are not in a group.");
  302.             }
  303.         } # End if solo join <name>
  304.  
  305.  
  306.         if ($text=~/^Delete Solo$/i)
  307.         {
  308.             my $SoloInstanceID  = "$name" . "_SoloI_" . "$zonesn" . "_" . "$zoneid";
  309.             my $SoloGroupID = "$name" . "_SoloI_GroupID_" . "$zonesn" . "_" . "$zoneid";
  310.  
  311.             if (GET_QGLOBAL_VALUE("$SoloInstanceID"))
  312.             {
  313.                 $client->Message(315," ");
  314.                 my $SPAM_NAME = "SPAM_SoloI_" . $name . "_$zonesn" . "_$zoneid";
  315.                 my $SPAM_TIME = 600; # Make 3600 / 1 HR
  316.                 if (GET_QGLOBAL_VALUE_EXPIRE("$SPAM_NAME"))
  317.                 {
  318.                     my $SPAM_VALUE  = GET_QGLOBAL_VALUE("$SPAM_NAME");
  319.                     my $TIME_LEFT   = $SPAM_TIME + $SPAM_VALUE - time();
  320.                     $client->Message(315,"You can't delete Solo Instance for $TIME_LEFT more seconds.");
  321.                 }
  322.                 else
  323.                 {
  324.                     my $InstID = GET_QGLOBAL_VALUE("$SoloInstanceID");
  325.                     quest::DestroyInstance($InstID);
  326.                     quest::delglobal($SoloInstanceID);
  327.                     quest::delglobal($SoloGroupID);
  328.                     $client->Message(315, "Solo Instance ($InstID) Deleted!");
  329.                 }
  330.             }
  331.             else
  332.             {
  333.                 $client->Message(315, "You do not have a solo instance to delete!");
  334.             }
  335.             $qglobals{"$SoloInstanceID"} = undef;
  336.             $qglobals{"$SoloGroupID"} = undef;
  337.         }
  338.     }
  339.     ###  END SOLO INSTANCES #######################################################################
  340.     ###############################################################################################
  341.  
  342.  
  343.     ###############################################################################################
  344.     ### START RAID INSTANCES #####################################################################
  345.     if ($RaidStatus == 1)
  346.     {
  347.         if ($text=~/^Instance$/i || $text=~/^Instances$/i || $text=~/^Waypoint$/i)
  348.         {
  349.             my $RaidID = $name;
  350.             my $RaidInstanceID = "$RaidID" . "_RaidI_" . "$zonesn" . "_" . "$zoneid";
  351.  
  352.             my $RaidGroup = $client->GetRaid();
  353.             my $Raid_Group_Global_Name = "RaidI_Group_";
  354.             if (defined($RaidGroup))
  355.             {
  356.                 my $raidID = $RaidGroup->GetID();
  357.                 $Raid_Group_Global_Name = "RaidI_Group_" . $raidID . "_$zonesn" . "_$zoneid";
  358.             }
  359.  
  360.             if (GET_QGLOBAL_VALUE("$RaidInstanceID") || GET_QGLOBAL_VALUE("$Raid_Group_Global_Name"))
  361.             {
  362.                 my $EnterRaidInstance       = quest::saylink("Enter Raid", 1);
  363.                 my $DeleteRaidInstance      = quest::saylink("Delete Raid", 1);
  364.                 my $RaidList                = quest::saylink("Raid List", 1);
  365.                 $client->Message(315,"[$EnterRaidInstance] [$DeleteRaidInstance] [$RaidList]");
  366.             }
  367.             else
  368.             {
  369.                 my $RaidCreate = quest::saylink("Create Raid Instance", 1);
  370.                 my $RaidCost = RAID_PRICE();
  371.                 $client->Message(315,"[$RaidCreate] : $RaidCost Platinum");
  372.             }
  373.             $qglobals{"$RaidInstanceID"} = undef;
  374.         }
  375.  
  376.         if($text=~/^Create Raid Instance$/i)
  377.         {
  378.             # my $RaidID = $name;
  379.             my $RaidInstanceID = "$name" . "_RaidI_" . "$zonesn" . "_" . "$zoneid";
  380.  
  381.             my $RaidGroup = $client->GetRaid();
  382.             my $Raid_Group_Global_Name = "RaidI_Group_";
  383.  
  384.             if (defined($RaidGroup))
  385.             {
  386.                 my $raidID = $RaidGroup->GetID();
  387.                 $Raid_Group_Global_Name = "RaidI_Group_" . $raidID . "_$zonesn" . "_$zoneid";
  388.             }
  389.  
  390.             if (GET_QGLOBAL_VALUE("$RaidInstanceID") || GET_QGLOBAL_VALUE("$Raid_Group_Global_Name"))
  391.             {
  392.                 $client->Message(315,"You already have or belong to a Raid Instance for $zonesn.");
  393.             }
  394.             else
  395.             {
  396.                 my $accountid = $client->AccountID();
  397.                 my $bankcredit = GET_QGLOBAL_VALUE("BankCredit_$accountid");
  398.                 my $RaidCost = RAID_PRICE();
  399.                 my $cost = $RaidCost;
  400.                 my $SPAM_NAME = "SPAM_RaidI_" . $name . "_" . $zonesn . "_" . $zoneid;
  401.                 my $SPAM_TIME = 600; # Make 3600 / 1 HR
  402.                 if ($bankcredit < $cost)
  403.                 {
  404.                     $client->Message(315,"You need ". ($cost - $bankcredit) . " more plat!");
  405.                 }
  406.                 elsif (GET_QGLOBAL_VALUE_EXPIRE("$SPAM_NAME"))
  407.                 {
  408.                     my $SPAM_VALUE  = GET_QGLOBAL_VALUE("$SPAM_NAME");
  409.                     my $TIME_LEFT   = $SPAM_TIME + $SPAM_VALUE - time();
  410.                     $client->Message(315,"You can create another Raid Instance in $TIME_LEFT seconds.");
  411.                 }
  412.                 else
  413.                 {
  414.                     quest::setglobal("$SPAM_NAME",time(),"7","S$SPAM_TIME"); # PREVENT CREATE SPAM FOR THIS ZONE
  415.  
  416.                     PayInstance("BankCredit", $cost, "Raid Instance");
  417.                     my $InstVersion = 0; # Must be 0 to load NPCs in an instance
  418.                     my $InstanceDuration = 259200;
  419.                     my $EnterRaidInstance = quest::saylink("Enter Raid", 1);
  420.                     my $InstID = quest::CreateInstance("$zonesn", $InstVersion, $InstanceDuration);
  421.  
  422.                     my $LeaderZone = $InstID . "_RaidI_" . $zonesn . "_" . "$zoneid";               # Qglobal name for Raid Instance ID + zone to do raid invites
  423.                     quest::setglobal("$LeaderZone","$InstID","7","S$InstanceDuration");             # Qglobal name for Raid Instance ID + zone to do raid invites
  424.  
  425.                     my $LeaderName = $InstID . "_RaidI_Leader";                                     # Qglobal Instance/Zone ID to Leaders Name
  426.                     quest::setglobal("$LeaderName","$name","7","S$InstanceDuration");               # Qglobal Instance/Zone ID to Leaders Name
  427.  
  428.                     my $LeaderTime = $InstID . "_RaidI_Time";                                       # Qglobal Raid Instance Timer
  429.                     my $Expire_Time = time() + $InstanceDuration;                                   # Qglobal Raid Instance Timer
  430.                     quest::setglobal("$LeaderTime","$Expire_Time","7","S$InstanceDuration");        # Qglobal Raid Instance Timer
  431.  
  432.                     # my $RaidGroup = $client->GetRaid(); # $RaidGroup Moved to top of this function
  433.                     if (defined($RaidGroup))
  434.                     {
  435.                         my $raidID = $RaidGroup->GetID();
  436.                         $Raid_Group_Global_Name     = "RaidI_Group_" . $raidID . "_$zonesn" . "_$zoneid";           # Qglobal Instance/Zone ID to Leaders Name
  437.                         my $Raid_DELETE             = "$name" . "_RaidI_DELETE_" . "$zonesn" . "_" . "$zoneid";     # Qglobal Instance/Zone ID to DELETE
  438.                         quest::setglobal("$Raid_Group_Global_Name","$InstID","7","S$InstanceDuration");             # Qglobal Raid Instance Timer
  439.                         quest::setglobal("$Raid_DELETE","$Raid_Group_Global_Name","7","S$InstanceDuration");        # Qglobal Raid Instance DELETE
  440.                         $qglobals{"$Raid_Group_Global_Name"}  = undef;
  441.                     }
  442.  
  443.                     quest::setglobal("$RaidInstanceID","$InstID","7","S$InstanceDuration");                     # Qglobal Set Raid Instance ID
  444.                     quest::AssignToInstance($InstID);
  445.                     $client->Message(315,"You created a Raid Instance ($InstID) for $zonesn.");
  446.                     $client->Message(315,"Would you like to $EnterRaidInstance instance?");
  447.                     $qglobals{"$LeaderZone"} = undef;
  448.                     $qglobals{"$LeaderName"} = undef;
  449.                 } # create instance then send
  450.                 $qglobals{"$SPAM_NAME"}  = undef;
  451.             }
  452.             $qglobals{"$RaidInstanceID"} = undef;
  453.         }
  454.  
  455.         if($text=~/^Enter Raid$/i)
  456.         {
  457.             my $RaidInstanceID = "$name" . "_RaidI_" . "$zonesn" . "_" . "$zoneid";
  458.  
  459.             my $RaidGroup = $client->GetRaid();
  460.             my $Raid_Group_Global_Name = "RaidI_Group_";
  461.             if (defined($RaidGroup))
  462.             {
  463.                 my $raidID = $RaidGroup->GetID();
  464.                 $Raid_Group_Global_Name = "RaidI_Group_" . $raidID . "_$zonesn" . "_$zoneid";
  465.             }
  466.  
  467.             if (GET_QGLOBAL_VALUE("$RaidInstanceID") || GET_QGLOBAL_VALUE("$Raid_Group_Global_Name"))
  468.             {
  469.                 my $timestamp = localtime(time);
  470.                 my $InstID = 0;
  471.  
  472.                 if (GET_QGLOBAL_VALUE("$RaidInstanceID"))               { $InstID = GET_QGLOBAL_VALUE("$RaidInstanceID"); }
  473.                 elsif (GET_QGLOBAL_VALUE("$Raid_Group_Global_Name"))    { $InstID = GET_QGLOBAL_VALUE("$Raid_Group_Global_Name"); }
  474.                 else                                                    { $client->Message(315, "Raid Group ID Error!!"); }
  475.  
  476.                 my $Cx = $client->GetX();
  477.                 my $Cy = $client->GetY();
  478.                 my $Cz = $client->GetZ();
  479.                 quest::popup("ENTER RAID INSTANCE","<br>
  480.                             <c \"#FE2E2E\">Moving you to a RAID instance!<br>
  481.                             <br>
  482.                             <c \"#FFFF49\">Time : &nbsp;&nbsp;&nbsp;<c \"#00FF00\">$timestamp<br>
  483.                             <c \"#FFFF49\">Name : &nbsp; <c \"#00FF00\">$name<br>
  484.                             <c \"#FFFF49\">Zone : &nbsp;&nbsp;&nbsp; <c \"#00FF00\">$zonesn<br>
  485.                             <c \"#FFFF49\">Type : &nbsp;&nbsp;&nbsp;&nbsp; <c \"#00FF00\">Raid<br>
  486.                             <br>
  487.                             <c \"#00BFFF\">ENJOY!<br>
  488.                             <br>
  489.                             ",1050,0);
  490.                 $client->Message(315, " ");
  491.                 $client->Message(315, "Moving you to Raid Instance ($InstID) for $zonesn.");
  492.                 quest::AssignToInstance($InstID);
  493.                 quest::MovePCInstance($zoneid, $InstID, $Cx, $Cy, $Cz);
  494.             }
  495.             else
  496.             {
  497.                 $client->Message(315,"You do not have a Raid Instance for $zonesn.");
  498.             }   # create instance then send
  499.             $qglobals{"$RaidInstanceID"} = undef;
  500.         }
  501.  
  502.         if ($text=~/^Delete Raid$/i)
  503.         {
  504.             $client->Message(315, " ");
  505.             my $RaidInstanceID = "$name" . "_RaidI_" . "$zonesn" . "_" . "$zoneid";
  506.             if (GET_QGLOBAL_VALUE("$RaidInstanceID"))
  507.             {
  508.                 my $SPAM_NAME = "SPAM_RaidI_" . $name . "_" . $zonesn . "_" . $zoneid;
  509.                 my $SPAM_TIME = 600; # Make 3600 / 1 HR
  510.                 if (GET_QGLOBAL_VALUE_EXPIRE("$SPAM_NAME"))
  511.                 {
  512.                     my $SPAM_VALUE  = GET_QGLOBAL_VALUE("$SPAM_NAME");
  513.                     my $TIME_LEFT   = $SPAM_TIME + $SPAM_VALUE - time();
  514.                     $client->Message(315,"You can't delete Raid Instance for $TIME_LEFT more seconds.");
  515.                 }
  516.                 else
  517.                 {
  518.                     my $InstID = GET_QGLOBAL_VALUE("$RaidInstanceID");
  519.                     my $Raid_DELETE = "$name" . "_RaidI_DELETE_" . "$zonesn" . "_" . "$zoneid";     # Qglobal Instance/Zone ID to DELETE
  520.                     my $LeaderZone = $InstID . "_RaidI_" . $zonesn . "_" . "$zoneid";       # Qglobal name for charid + zonesn to invite raid
  521.                     my $LeaderName = $InstID . "_RaidI_Leader";                             # Qglobal ID to Name
  522.                     my $LeaderTime = $InstID . "_RaidI_Time";                               # Qglobal Time
  523.  
  524.                     # DELETE Raid Player Invited List
  525.                     my $count = 1;
  526.                     my $raid_invite_name = $InstID . "_RaidI_Status_";
  527.                     my $temp_del = "";
  528.                     while ($count > 0)
  529.                     {
  530.                         if (GET_QGLOBAL_VALUE("$raid_invite_name$count"))
  531.                         {
  532.                             $temp_del = $raid_invite_name . $count;
  533.                             quest::delglobal($temp_del);
  534.                             $count ++;
  535.                         }
  536.                         else
  537.                         {
  538.                             $count = $count - 1;
  539.                             # quest::gmsay("GM: Deleted $count Invited Players!", 18, 0);
  540.                             $count = 0;
  541.                         }
  542.                     }
  543.                     # END DELETE Raid Player Invited List
  544.  
  545.                     $client->Message(315, "Raid Instance ($InstID) Deleted!");
  546.                     quest::DestroyInstance($InstID);
  547.                     quest::delglobal($RaidInstanceID);
  548.                     quest::delglobal($LeaderZone);
  549.                     quest::delglobal($LeaderName);
  550.                     quest::delglobal($LeaderTime);
  551.  
  552.                     my $Raid_DELETE = "$name" . "_RaidI_DELETE_" . "$zonesn" . "_" . "$zoneid";     # Qglobal Instance/Zone ID to DELETE
  553.                     if (GET_QGLOBAL_VALUE("$Raid_DELETE"))
  554.                     {
  555.                         my $DELETE_THIS_RAID_GROUP = GET_QGLOBAL_VALUE("$Raid_DELETE");
  556.                         quest::delglobal($Raid_DELETE);
  557.                         quest::delglobal($DELETE_THIS_RAID_GROUP);
  558.                     }
  559.  
  560.                     my $RaidGroup = $client->GetRaid();
  561.                     my $Raid_Group_Global_Name = "RaidI_Group_";
  562.                     if (defined($RaidGroup))
  563.                     {
  564.                         my $raidID = $RaidGroup->GetID();
  565.                         $Raid_Group_Global_Name = "RaidI_Group_" . $raidID . "_$zonesn" . "_$zoneid";
  566.                         quest::delglobal($Raid_Group_Global_Name);
  567.                         $qglobals{"$Raid_Group_Global_Name"} = undef;
  568.                     }
  569.  
  570.                     $qglobals{"$LeaderZone"} = undef;
  571.                     $qglobals{"$LeaderName"} = undef;
  572.                     $qglobals{"$LeaderTime"} = undef;
  573.                 }
  574.             }
  575.             else
  576.             {
  577.                 $client->Message(315, "You do not have (or are not leader of) a Raid Instance to delete!");
  578.             }
  579.             $qglobals{"$RaidInstanceID"} = undef;
  580.         }
  581.     }
  582.     ###  END RAID INSTANCES ######################################################################
  583.     ###############################################################################################
  584.  
  585.  
  586.     ###############################################################################################
  587.     ### START GUILD INSTANCES #####################################################################
  588.     if ($GuildStatus == 1)
  589.     {
  590.         if ($text=~/^Instance$/i || $text=~/^Instances$/i || $text=~/^Waypoint$/i)
  591.         {
  592.             my $GuildID = $uguild_id;
  593.             my $GuildInstanceID = "GuildI_" . "$GuildID" . "_$zonesn" . "_$zoneid";
  594.             if (GET_QGLOBAL_VALUE("$GuildInstanceID"))
  595.             {
  596.                 my $EnterGuildInstance      = quest::saylink("Enter Guild", 1);
  597.                 my $DeleteGuildInstance     = quest::saylink("Delete Guild", 1);
  598.                 my $GuildList               = quest::saylink("Guild List", 1);
  599.                 $client->Message(315,"[$EnterGuildInstance] [$DeleteGuildInstance] [$GuildList]");
  600.             }
  601.             else
  602.             {
  603.                 my $GuildCreate = quest::saylink("Create Guild Instance", 1);
  604.                 my $GuildCost = GUILD_PRICE();
  605.                 $client->Message(315,"[$GuildCreate] : $GuildCost Platinum");
  606.             }
  607.             $qglobals{"$GuildInstanceID"} = undef;
  608.         }
  609.  
  610.         if($text=~/^Create Guild Instance$/i && $uguild_id < 1)
  611.         {
  612.             $client->Message(315,"You do not belong to any guild!");
  613.         }
  614.         if($text=~/^Create Guild Instance$/i && $uguild_id > 0)
  615.         {
  616.             my $GuildID = $uguild_id;
  617.             my $GuildInstanceID = "GuildI_" . "$GuildID" . "_$zonesn" . "_$zoneid";     # Unique Guild Instance via Guild ID
  618.             my $GuildInstanceID2 = "$name" . "_GuildI_"  . $zonesn . "_$zoneid";        # Who created Guild Instance, used for Invites
  619.             if (GET_QGLOBAL_VALUE("$GuildInstanceID"))
  620.             {
  621.                 $client->Message(315,"You already have a Guild Instance for $zonesn.");
  622.             }
  623.             else
  624.             {
  625.                 my $accountid = $client->AccountID();
  626.                 my $bankcredit = GET_QGLOBAL_VALUE("BankCredit_$accountid");
  627.                 my $GuildCost = GUILD_PRICE();
  628.                 my $cost = $GuildCost;
  629.                 my $SPAM_NAME = "SPAM_GuildI_" . $uguild_id . "_" . $zonesn . "_" . $zoneid;
  630.                 my $SPAM_TIME = 600; # Make 3600 / 1 HR
  631.                 if ($bankcredit < $cost)
  632.                 {
  633.                     $client->Message(315,"You need ". ($cost - $bankcredit) . " more plat!");
  634.                 }
  635.                 elsif (GET_QGLOBAL_VALUE_EXPIRE("$SPAM_NAME"))
  636.                 {
  637.                     my $SPAM_VALUE  = GET_QGLOBAL_VALUE("$SPAM_NAME");
  638.                     my $TIME_LEFT   = $SPAM_TIME + $SPAM_VALUE - time();
  639.                     $client->Message(315,"You can create another Guild Instance in $TIME_LEFT seconds.");
  640.                 }
  641.                 else
  642.                 {
  643.                     quest::setglobal("$SPAM_NAME",time(),"7","S$SPAM_TIME"); # PREVENT CREATE SPAM FOR THIS ZONE
  644.  
  645.                     PayInstance("BankCredit", $cost, "Guild Instance");
  646.                     my $InstVersion = 0;            # MUST be 0 to load NPCs in an instance!
  647.                     my $InstanceDuration = 259200;
  648.                     my $EnterGuildInstance = quest::saylink("Enter Guild", 1);
  649.                     my $InstID = quest::CreateInstance("$zonesn", $InstVersion, $InstanceDuration);
  650.  
  651.                     my $LeaderZone = $InstID . "_GuildI_" . $zonesn . "_" . "$zoneid";              # Qglobal name for Guild Instance ID + zone to do guild invites
  652.                     quest::setglobal("$LeaderZone","$InstID","7","S$InstanceDuration");             # Qglobal name for Guild Instance ID + zone to do guild invites
  653.  
  654.                     my $LeaderName = $InstID . "_GuildI_Leader";                                    # Qglobal Instance/Zone ID to Leaders Name
  655.                     quest::setglobal("$LeaderName","$name","7","S$InstanceDuration");               # Qglobal Instance/Zone ID to Leaders Name
  656.  
  657.                     my $LeaderTime = $InstID . "_GuildI_Time";                                      # Qglobal Guild Instance Timer
  658.                     my $Expire_Time = time() + $InstanceDuration;                                   # Qglobal Guild Instance Timer
  659.                     quest::setglobal("$LeaderTime","$Expire_Time","7","S$InstanceDuration");        # Qglobal Guild Instance Timer
  660.  
  661.                     quest::setglobal("$GuildInstanceID","$InstID","7","S$InstanceDuration");        # Qglobal Set Guild Instance ID
  662.                     quest::setglobal("$GuildInstanceID2","$InstID","7","S$InstanceDuration");       # Qglobal Set Guild Instance ID 2
  663.                     quest::AssignToInstance($InstID);
  664.                     $client->Message(315,"You created a Guild Instance ($InstID) for $zonesn.");
  665.                     $client->Message(315,"Would you like to $EnterGuildInstance instance?");
  666.                     $qglobals{"$LeaderZone"} = undef;
  667.                     $qglobals{"$LeaderName"} = undef;
  668.                 } # create instance then send
  669.                 $qglobals{"$SPAM_NAME"}  = undef;
  670.             }
  671.             $qglobals{"$GuildInstanceID"} = undef;
  672.             $qglobals{"$GuildInstanceID2"} = undef;
  673.         }
  674.  
  675.         if($text=~/^Enter Guild$/i)
  676.         {
  677.             my $GuildID = $uguild_id;
  678.             my $GuildInstanceID = "GuildI_" . "$GuildID" . "_$zonesn" . "_$zoneid";
  679.             if (GET_QGLOBAL_VALUE("$GuildInstanceID"))
  680.             {
  681.                 my $timestamp = localtime(time);
  682.                 my $InstID = GET_QGLOBAL_VALUE("$GuildInstanceID");
  683.                 my $Cx = $client->GetX();
  684.                 my $Cy = $client->GetY();
  685.                 my $Cz = $client->GetZ();
  686.                 quest::popup("ENTER GUILD INSTANCE","<br>
  687.                             <c \"#FE2E2E\">Moving you to a GUILD instance!<br>
  688.                             <br>
  689.                             <c \"#FFFF49\">Time : &nbsp;&nbsp;&nbsp;<c \"#00FF00\">$timestamp<br>
  690.                             <c \"#FFFF49\">Name : &nbsp; <c \"#00FF00\">$name<br>
  691.                             <c \"#FFFF49\">Zone : &nbsp;&nbsp;&nbsp; <c \"#00FF00\">$zonesn<br>
  692.                             <c \"#FFFF49\">Type : &nbsp;&nbsp;&nbsp;&nbsp; <c \"#00FF00\">Guild<br>
  693.                             <br>
  694.                             <c \"#00BFFF\">ENJOY!<br>
  695.                             <br>
  696.                             ",1050,0);
  697.                 $client->Message(315, " ");
  698.                 $client->Message(315, "Moving you to Guild Instance ($InstID) for $zonesn.");
  699.                 quest::AssignToInstance($InstID);
  700.                 quest::MovePCInstance($zoneid, $InstID, $Cx, $Cy, $Cz);
  701.             }
  702.             else
  703.             {
  704.                 $client->Message(315,"You do not have a Guild Instance for $zonesn.");
  705.             }   # create instance then send
  706.             $qglobals{"$GuildInstanceID"} = undef;
  707.         }
  708.  
  709.         if ($text=~/^Delete Guild$/i)
  710.         {
  711.             $client->Message(315, " ");
  712.             my $GuildID = $uguild_id;
  713.             my $GuildInstanceID = "GuildI_" . "$GuildID" . "_$zonesn" . "_$zoneid";
  714.             my $GuildInstanceID2 = "$name" . "_GuildI_"  . $zonesn . "_$zoneid";
  715.             if (GET_QGLOBAL_VALUE("$GuildInstanceID"))
  716.             {
  717.                 my $SPAM_NAME = "SPAM_GuildI_" . $uguild_id . "_" . $zonesn . "_" . $zoneid;
  718.                 my $SPAM_TIME = 600; # Make 3600 / 1 HR
  719.                 if (GET_QGLOBAL_VALUE_EXPIRE("$SPAM_NAME"))
  720.                 {
  721.                     my $SPAM_VALUE  = GET_QGLOBAL_VALUE("$SPAM_NAME");
  722.                     my $TIME_LEFT   = $SPAM_TIME + $SPAM_VALUE - time();
  723.                     $client->Message(315,"You can't delete Guild Instance for $TIME_LEFT more seconds.");
  724.                 }
  725.                 else
  726.                 {
  727.                     my $InstID = GET_QGLOBAL_VALUE("$GuildInstanceID");
  728.                     my $LeaderZone = $InstID . "_GuildI_" . $zonesn . "_" . "$zoneid";
  729.                     my $LeaderName = $InstID . "_GuildI_Leader";
  730.                     my $LeaderTime = $InstID . "_GuildI_Time";
  731.                     # DELETE List of Players Invited to Guild Instance
  732.                     my $count = 1;
  733.                     my $guild_invite_name = $InstID . "_GuildI_Status_";
  734.                     my $temp_del = "";
  735.                     while ($count > 0)
  736.                     {
  737.                         if (GET_QGLOBAL_VALUE("$guild_invite_name$count"))
  738.                         {
  739.                             $temp_del = $guild_invite_name . $count;
  740.                             quest::delglobal($temp_del);
  741.                             $count ++;
  742.                         }
  743.                         else
  744.                         {
  745.                             $count = $count - 1;
  746.                             # quest::gmsay("GM: Deleted $count Invited Players!", 18, 0);
  747.                             $count = 0;
  748.                         }
  749.                     }
  750.                     # END DELETE List of Players Invited to Guild Instance
  751.                     quest::DestroyInstance($InstID);
  752.                     quest::delglobal($GuildInstanceID);
  753.                     quest::delglobal($GuildInstanceID2);
  754.                     quest::delglobal($LeaderZone);
  755.                     quest::delglobal($LeaderName);
  756.                     quest::delglobal($LeaderTime);
  757.                     $client->Message(315, "Guild Instance ($InstID) Deleted!");
  758.  
  759.                     $qglobals{"$LeaderZone"} = undef;
  760.                     $qglobals{"$LeaderName"} = undef;
  761.                     $qglobals{"$LeaderTime"} = undef;
  762.                 }
  763.             }
  764.             else
  765.             {
  766.                 $client->Message(315, "You do not have a Guild Instance to delete!");
  767.             }
  768.             $qglobals{"$GuildInstanceID"} = undef;
  769.             $qglobals{"$GuildInstanceID2"} = undef;
  770.         }
  771.     }
  772.     ###  END GUILD INSTANCES ######################################################################
  773.     ###############################################################################################
  774.  
  775.  
  776.     if ($text=~/^Instance$/i || $text=~/^Instances$/i || $text=~/^Waypoint$/i)
  777.     {
  778.         my $LeaveInstance   = quest::saylink("Leave Instance", 1);
  779.         my $MoreOptions     = quest::saylink("More Options", 1);
  780.         $client->Message(315, "[$LeaveInstance] [$MoreOptions]");
  781.     }
  782.  
  783.  
  784.     if($text=~/^Guild Invite$/i)
  785.     {
  786.         $client->Message(315, " ");
  787.         $client->Message(315, "Syntax: guild invite <Player Name>");
  788.     }
  789.  
  790.  
  791.     if($text=~/^Raid Invite$/i)
  792.     {
  793.         $client->Message(315, " ");
  794.         $client->Message(315, "Syntax: raid invite <Player Name>");
  795.     }
  796.  
  797.  
  798.     # INVITE Guild Member
  799.     if($text=~/^Guild Invite /i && $text ne "Guild Invite")
  800.     {
  801.         my $GuildID = $uguild_id;
  802.         my $GuildInstanceID = "GuildI_" . "$GuildID" . "_$zonesn" . "_$zoneid";
  803.  
  804.         ##########################################################################################################################
  805.         ### NEW INVITE CODE MULTIPLE NAME INVITE SPLIT BY COMMA
  806.         ##########################################################################################################################
  807.         if (GET_QGLOBAL_VALUE("$GuildInstanceID"))
  808.         {
  809.             my $GetFriendName = substr($text, 13);
  810.             my @FriendNames = split(',', $GetFriendName); #Split the names into an array by comma
  811.             my $Instance_Invite = 0 + GET_QGLOBAL_VALUE("$GuildInstanceID");
  812.             my $ZoneConvert = $zoneid * 1000000; # Include Zone ID in the Signal, multiple of 1 million (1-999 Million)
  813.             my $Instance_Invite_Convert = $Instance_Invite + $ZoneConvert;
  814.             #Loop through the array of Names to invite
  815.             foreach my $FriendName (@FriendNames)
  816.             {
  817.                 $FriendName =~ s/^\s+|\s+$//g; #Strip spaces from the beginning or end of the name
  818.                 quest::crosszonesignalclientbyname($FriendName, $Instance_Invite_Convert);
  819.                 $client->Message(315, " ");
  820.                 $client->Message(315, "You sent an invite to $FriendName to join Guild Instance ($Instance_Invite) in $zonesn.");
  821.                 # $client->Message(315, "You sent an invite to $FriendName to join instance ($Instance_Invite) in $zonesn.");
  822.             }
  823.         }
  824.         ##########################################################################################################################
  825.         else
  826.         {
  827.             $client->Message(315, " ");
  828.             $client->Message(315, "You do not have a Guild Instance for inviting.");
  829.         }
  830.         $qglobals{"$GuildInstanceID"} = undef;
  831.     }
  832.  
  833.  
  834.     # INVITE Raid Member
  835.     if($text=~/^Raid Invite /i && $text ne "Raid Invite")
  836.     {
  837.         my $RaidID = $name;
  838.         my $RaidInstanceID = "$RaidID" . "_RaidI_" . "$zonesn" . "_" . "$zoneid";
  839.  
  840.         ##########################################################################################################################
  841.         ### NEW INVITE CODE MULTIPLE NAME INVITE SPLIT BY COMMA
  842.         ##########################################################################################################################
  843.         if (GET_QGLOBAL_VALUE("$RaidInstanceID"))
  844.         {
  845.             my $GetFriendName = substr($text, 12);
  846.             my @FriendNames = split(',', $GetFriendName); #Split the names into an array by comma
  847.             my $Instance_Invite = 0 + GET_QGLOBAL_VALUE("$RaidInstanceID");
  848.             my $ZoneConvert = $zoneid * 1000000; # Include Zone ID in the Signal, multiple of 1 million (1-999 Million)
  849.             my $Instance_Invite_Convert = $Instance_Invite + $ZoneConvert;
  850.             #Loop through the array of Names to invite
  851.             foreach my $FriendName (@FriendNames)
  852.             {
  853.                 $FriendName =~ s/^\s+|\s+$//g; #Strip spaces from the beginning or end of the name
  854.                 quest::crosszonesignalclientbyname($FriendName, $Instance_Invite_Convert);
  855.                 $client->Message(315, " ");
  856.                 $client->Message(315, "You sent an invite to $FriendName to join Raid Instance ($Instance_Invite) in $zonesn.");
  857.                 # $client->Message(315, "You sent an invite to $FriendName to join instance ($Instance_Invite) in $zonesn.");
  858.             }
  859.         }
  860.         ##########################################################################################################################
  861.         else
  862.         {
  863.             $client->Message(315, " ");
  864.             $client->Message(315, "You do not have (or are not leader of) a Raid Instance for inviting.");
  865.         }
  866.         $qglobals{"$RaidInstanceID"} = undef;
  867.     }
  868.  
  869.  
  870.     # REMOVE Guild Member
  871.     if($text=~/^Guild Remove /i && $text ne "Guild Remove")
  872.     {
  873.         my $GuildID = $uguild_id;
  874.         my $GuildInstanceID = "GuildI_" . "$GuildID" . "_$zonesn" . "_$zoneid";
  875.         if (GET_QGLOBAL_VALUE("$GuildInstanceID"))
  876.         {
  877.             my $GetFriendName = substr($text, 13);
  878.             my $Instance_Remove = 0 + GET_QGLOBAL_VALUE("$GuildInstanceID");
  879.             my $Instance_Remove2 =  $Instance_Remove + 1000000000 + ($zoneid * 1000000); # 1,000,000,000
  880.             quest::crosszonesignalclientbyname($GetFriendName, $Instance_Remove2);
  881.             $client->Message(315, " ");
  882.             $client->Message(315, "You removed $GetFriendName from Guild Instance ($Instance_Remove) in $zonesn.");
  883.         }
  884.         else
  885.         {
  886.             $client->Message(315, " ");
  887.             $client->Message(315, "You do not have a Guild Instance for removing.");
  888.         }
  889.         $qglobals{"$GuildInstanceID"} = undef;
  890.     }
  891.  
  892.  
  893.     # REMOVE Raid Member
  894.     if($text=~/^Raid Remove /i && $text ne "Raid Remove")
  895.     {
  896.         my $RaidID = $name;
  897.         my $RaidInstanceID = "$RaidID" . "_RaidI_" . "$zonesn" . "_" . "$zoneid";
  898.         if (GET_QGLOBAL_VALUE("$RaidInstanceID"))
  899.         {
  900.             my $GetFriendName = substr($text, 12);
  901.             my $Instance_Remove = 0 + GET_QGLOBAL_VALUE("$RaidInstanceID");
  902.             my $Instance_Remove2 =  $Instance_Remove + 1000000000 + ($zoneid * 1000000); # 1,000,000,000
  903.             quest::crosszonesignalclientbyname($GetFriendName, $Instance_Remove2);
  904.             $client->Message(315, " ");
  905.             $client->Message(315, "You removed $GetFriendName from Raid Instance ($Instance_Remove) in $zonesn.");
  906.         }
  907.         else
  908.         {
  909.             $client->Message(315, " ");
  910.             $client->Message(315, "You do not have (or are not leader of) a Raid Instance for removing.");
  911.         }
  912.         $qglobals{"$RaidInstanceID"} = undef;
  913.     }
  914.  
  915.  
  916.     if($text=~/^guild join$/i)
  917.     {
  918.         $client->Message(315, " ");
  919.         $client->Message(315,"Syntax: guild join <Player Name>");
  920.     }
  921.  
  922.  
  923.     if($text=~/^raid join$/i)
  924.     {
  925.         $client->Message(315, " ");
  926.         $client->Message(315,"Syntax: raid join <Player Name>");
  927.     }
  928.  
  929.     if($text=~/^guild remove$/i)
  930.     {
  931.         $client->Message(315, " ");
  932.         $client->Message(315,"Syntax: guild remove <Player Name>");
  933.     }
  934.  
  935.  
  936.     if($text=~/^raid remove$/i)
  937.     {
  938.         $client->Message(315, " ");
  939.         $client->Message(315,"Syntax: raid remove <Player Name>");
  940.     }
  941.  
  942.  
  943.  
  944.     ###############################################################################################
  945.     ### JOIN GUILD INSTANCE #######################################################################
  946.     if($text=~/^guild join /i)
  947.     {
  948.         my $Check_G_Leader = substr($text, 11);
  949.         my $Check_G_Invite = "_GuildI_" . $zonesn . "_" . "$zoneid";
  950.         my $GetGuildInstanceGlobal = $Check_G_Leader . "_GuildI_" . $zonesn . "_" . $zoneid;
  951.         my $GetJoinID = 0;
  952.  
  953.         if (GET_QGLOBAL_VALUE("$GetGuildInstanceGlobal"))
  954.         {
  955.             $GetJoinID = GET_QGLOBAL_VALUE("$GetGuildInstanceGlobal");
  956.             $Check_G_Invite = $GetJoinID . $Check_G_Invite;
  957.         }
  958.  
  959.         if (GET_QGLOBAL_VALUE("$Check_G_Invite"))
  960.         {
  961.             # Find Player Qglobal to change status
  962.             my $count                   = 1;
  963.             my $guild_invite_name       = $GetJoinID . "_GuildI_Status_";
  964.             my $guild_invite_pending    = $name . "_pending";
  965.             my $guild_invite_joined     = $name . "_joined";
  966.             my $guild_invite_removed    = $name . "_removed";
  967.             my $compare_name            = "";
  968.             my $Leader = $Check_G_Leader;
  969.             while ($count > 0)
  970.             {
  971.                 if (GET_QGLOBAL_VALUE("$guild_invite_name$count"))
  972.                 {
  973.                     $compare_name = GET_QGLOBAL_VALUE("$guild_invite_name$count");
  974.                     if ($compare_name eq $guild_invite_pending || $compare_name eq $guild_invite_joined)
  975.                     {
  976.                         # When pending or joined qglobal name found, change value from pending to joined, then enter.
  977.                         my $GetSeconds = GET_TIME_LEFT("GUILD", $GetJoinID);
  978.                         quest::setglobal("$guild_invite_name$count","$guild_invite_joined","7","S$GetSeconds");
  979.                         my $timestamp = localtime(time);
  980.                         my $Cx = $client->GetX();
  981.                         my $Cy = $client->GetY();
  982.                         my $Cz = $client->GetZ();
  983.                         quest::popup("ENTERING INVITED GUILD INSTANCE","<br>
  984.                             <c \"#FE2E2E\">Moving you to a INVITED Guild Instance ($GetJoinID)!<br>
  985.                             <br>
  986.                             <c \"#FFFF49\">Time : &nbsp;&nbsp;&nbsp;<c \"#00FF00\">$timestamp<br>
  987.                             <c \"#FFFF49\">Name : &nbsp; <c \"#00FF00\">$name<br>
  988.                             <c \"#FFFF49\">Zone : &nbsp;&nbsp;&nbsp; <c \"#00FF00\">$zonesn<br>
  989.                             <c \"#FFFF49\">Type : &nbsp;&nbsp;&nbsp;&nbsp; <c \"#00FF00\">$Leader Guild Instance<br>
  990.                             <br>
  991.                             <c \"#00BFFF\">ENJOY!<br>
  992.                             <br>
  993.                             ",1050,0);
  994.                         $client->Message(315, " ");
  995.                         $client->Message(315, "Moving you to $Leader Guild Instance ($GetJoinID) for $zonesn.");
  996.                         $qglobals{"$guild_invite_name"} = undef;
  997.                         quest::AssignToInstance($GetJoinID);
  998.                         quest::MovePCInstance($zoneid, $GetJoinID, $Cx, $Cy, $Cz);
  999.                         $count = 0;
  1000.                     }
  1001.                     elsif ($compare_name eq $guild_invite_removed)
  1002.                     {
  1003.                         $client->Message(315, " ");
  1004.                         $client->Message(315, "You were BANNED from $Leader Guild Instance ($GetJoinID) for $zonesn.");
  1005.                         $count = 0;
  1006.                     }
  1007.                     else
  1008.                     {
  1009.                         $count ++;
  1010.                     }
  1011.                 }
  1012.                 else
  1013.                 {
  1014.                     $client->Message(315,"You were not invited to $Leader Guild Instance $GetJoinID in $zonesn!");
  1015.                     $count = 0;
  1016.                 }
  1017.             }
  1018.         }
  1019.         else
  1020.         {
  1021.             $client->Message(315,"Guild Instance $Check_G_Leader in $zonesn does not exist!");
  1022.         }
  1023.         $qglobals{"$Check_G_Invite"} = undef;
  1024.         $qglobals{"$Check_G_Leader"} = undef;
  1025.     }
  1026.     ###  END JOIN GUILD INSTANCE ##################################################################
  1027.     ###############################################################################################
  1028.  
  1029.  
  1030.     ###############################################################################################
  1031.     ### JOIN RAID INSTANCE ########################################################################
  1032.     ### $name_Raid_$zonesn_$zoneid, XXX_RaidI_Leader, XXX__RaidI_Time, XXX_RaidI_$zonesn_$zoneid, XXX_RaidI_Status_YYY
  1033.     if($text=~/^raid join /i)
  1034.     {
  1035.         my $Check_R_Leader = substr($text, 10);
  1036.         my $Check_R_Invite = "_RaidI_" . $zonesn . "_" . "$zoneid";
  1037.         my $GetRaidInstanceGlobal = $Check_R_Leader . "_RaidI_" . $zonesn . "_" . $zoneid;
  1038.         my $GetJoinID = 0;
  1039.         if (GET_QGLOBAL_VALUE("$GetRaidInstanceGlobal"))
  1040.         {
  1041.             $GetJoinID = GET_QGLOBAL_VALUE("$GetRaidInstanceGlobal");
  1042.             $Check_R_Invite = $GetJoinID . $Check_R_Invite;
  1043.         }
  1044.  
  1045.         if (GET_QGLOBAL_VALUE("$Check_R_Invite"))
  1046.         {
  1047.             # Find Player Qglobal to change status
  1048.             my $count                   = 1;
  1049.             my $raid_invite_name        = $GetJoinID . "_RaidI_Status_";
  1050.             my $raid_invite_pending     = $name . "_pending";
  1051.             my $raid_invite_joined      = $name . "_joined";
  1052.             my $raid_invite_removed     = $name . "_removed";
  1053.             my $compare_name            = "";
  1054.             my $Leader = $Check_R_Leader;
  1055.             while ($count > 0)
  1056.             {
  1057.                 if (GET_QGLOBAL_VALUE("$raid_invite_name$count"))
  1058.                 {
  1059.                     $compare_name = GET_QGLOBAL_VALUE("$raid_invite_name$count");
  1060.                     if ($compare_name eq $raid_invite_pending || $compare_name eq $raid_invite_joined)
  1061.                     {
  1062.                         # When qglobal name found, change value from pending to joined, then enter
  1063.                         my $GetSeconds = GET_TIME_LEFT("RAID", $GetJoinID);
  1064.                         quest::setglobal("$raid_invite_name$count","$raid_invite_joined","7","S$GetSeconds");
  1065.  
  1066.                         my $timestamp = localtime(time);
  1067.                         my $Cx = $client->GetX();
  1068.                         my $Cy = $client->GetY();
  1069.                         my $Cz = $client->GetZ();
  1070.                         quest::popup("ENTERING INVITED RAID INSTANCE","<br>
  1071.                             <c \"#FE2E2E\">Moving you to a INVITED Raid Instance ($GetJoinID)!<br>
  1072.                             <br>
  1073.                             <c \"#FFFF49\">Time : &nbsp;&nbsp;&nbsp;<c \"#00FF00\">$timestamp<br>
  1074.                             <c \"#FFFF49\">Name : &nbsp; <c \"#00FF00\">$name<br>
  1075.                             <c \"#FFFF49\">Zone : &nbsp;&nbsp;&nbsp; <c \"#00FF00\">$zonesn<br>
  1076.                             <c \"#FFFF49\">Type : &nbsp;&nbsp;&nbsp;&nbsp; <c \"#00FF00\">$Leader Raid Instance<br>
  1077.                             <br>
  1078.                             <c \"#00BFFF\">ENJOY!<br>
  1079.                             <br>
  1080.                             ",1050,0);
  1081.                         $client->Message(315, " ");
  1082.                         $client->Message(315, "Moving you to $Leader Raid Instance ($GetJoinID) for $zonesn.");
  1083.                         $qglobals{"$raid_invite_name"} = undef;
  1084.                         quest::AssignToInstance($GetJoinID);
  1085.                         quest::MovePCInstance($zoneid, $GetJoinID, $Cx, $Cy, $Cz);
  1086.                         $count = 0;
  1087.                     }
  1088.                     elsif ($compare_name eq $raid_invite_removed)
  1089.                     {
  1090.                         $client->Message(315, " ");
  1091.                         $client->Message(315, "You were BANNED from $Leader Raid Instance ($GetJoinID) for $zonesn.");
  1092.                         $count = 0;
  1093.                     }
  1094.                     else
  1095.                     {
  1096.                         $count ++;
  1097.                     }
  1098.                 }
  1099.                 else
  1100.                 {
  1101.                     $client->Message(315,"You were not invited to $Leader Raid Instance $GetJoinID in $zonesn!");
  1102.                     $count = 0;
  1103.                 }
  1104.             }
  1105.         }
  1106.         else
  1107.         {
  1108.             $client->Message(315,"Raid Instance for $Check_R_Leader in $zonesn does not exist!");
  1109.         }
  1110.         $qglobals{"$Check_R_Invite"} = undef;
  1111.         $qglobals{"$Check_R_Leader"} = undef;
  1112.     }
  1113.     ###  END JOIN RAID INSTANCE ###################################################################
  1114.     ###############################################################################################
  1115.  
  1116.  
  1117.     #################################################################################################################################################
  1118.     # LIST of players invited/assigned to Guild Instance
  1119.     if($text=~/^Guild List$/i)
  1120.     {
  1121.         my $timestamp = localtime(time);
  1122.         $client->Message(315," ");
  1123.         my $GuildID = $uguild_id;
  1124.         my $GuildInstanceID = "GuildI_" . "$GuildID" . "_$zonesn" . "_$zoneid";
  1125.         if (GET_QGLOBAL_VALUE("$GuildInstanceID"))
  1126.         {
  1127.             my $Check_G_Invite = GET_QGLOBAL_VALUE("$GuildInstanceID") . "_GuildI_" . $zonesn . "_" . "$zoneid";
  1128.             my $Check_G_Leader = GET_QGLOBAL_VALUE("$GuildInstanceID") . "_GuildI_Leader";
  1129.             my $GID = GET_QGLOBAL_VALUE("$GuildInstanceID");
  1130.  
  1131.             # GET TIME LEFT UNTIL INSTANCE EXPIRES
  1132.             my $LeaderTime  = $GID . "_GuildI_Time";
  1133.             my $ExpireTime  = GET_QGLOBAL_VALUE("$LeaderTime");
  1134.             my $TimeLeft    = $ExpireTime - time();
  1135.             my $GetDays     = int($TimeLeft/(24*60*60));
  1136.             my $GetHours    = ($TimeLeft/(60*60))%24;
  1137.             my $GetMins     = ($TimeLeft/60)%60;
  1138.             my $GetSecs     = $TimeLeft%60;
  1139.  
  1140.             $client->Message(315,"Expires: $GetDays Day, $GetHours Hr, $GetMins Min, $GetSecs Sec");
  1141.             $client->Message(315,"List of players in your Guild Instance ($GID) in $zonesn!");
  1142.             my $names_list = "";
  1143.             my $temp_name = "";
  1144.             my $guild_invite_name = $GID . "_GuildI_Status_";
  1145.             my $count = 1;
  1146.             my $player_count = 0;
  1147.             while ($count > 0)
  1148.             {
  1149.                 if (GET_QGLOBAL_VALUE("$guild_invite_name$count"))
  1150.                 {
  1151.                     $player_count = $count;
  1152.                     $temp_name = GET_QGLOBAL_VALUE("$guild_invite_name$count");
  1153.                     if ($temp_name=~/pending$/i)
  1154.                     {
  1155.                         my $player_name = $temp_name;
  1156.                         $player_name =~ s/_pending//; # string substitute flag
  1157.                         my $player_status = " - Pending";
  1158.                         my $yellow = "<c \"#AEB404\">";
  1159.                         my $white = "<c \"#FFFFFF\">";
  1160.                         my $player_space = "&nbsp;";
  1161.                         my $BR = "<br>";
  1162.                         my $player_number = "<c \"#0489B1\">$count : "; # Teal Color
  1163.                         $names_list = $names_list . $player_number . $white . $player_name . $yellow . $player_status . $BR;
  1164.                     }
  1165.                     elsif ($temp_name=~/joined$/i)
  1166.                     {
  1167.                         my $player_name = $temp_name;
  1168.                         $player_name =~ s/_joined//;
  1169.                         my $player_status = " - Joined";
  1170.                         my $green = "<c \"#298A08\">";
  1171.                         my $white = "<c \"#FFFFFF\">";
  1172.                         my $player_space = "&nbsp;";
  1173.                         my $BR = "<br>";
  1174.                         my $player_number = "<c \"#0489B1\">$count : "; # Teal Color
  1175.                         $names_list = $names_list . $player_number . $white . $player_name . $green . $player_status . $BR;
  1176.                     }
  1177.                     elsif ($temp_name=~/removed$/i)
  1178.                     {
  1179.                         my $player_name = $temp_name;
  1180.                         $player_name =~ s/_removed//;
  1181.                         my $player_status = " - Removed";
  1182.                         my $red = "<c \"#FE2E2E\">";
  1183.                         my $white = "<c \"#FFFFFF\">";
  1184.                         my $player_space = "&nbsp;";
  1185.                         my $BR = "<br>";
  1186.                         my $player_number = "<c \"#0489B1\">$count : "; # Teal Color
  1187.                         $names_list = $names_list . $player_number . $white . $player_name . $red . $player_status . $BR;
  1188.                     }
  1189.                     else
  1190.                     {
  1191.                         quest::gmsay("GM: GUILD LIST ADD NAME ERROR.", 18, 0);
  1192.                     }
  1193.                     # quest::gmsay("GM: $temp_name added to List", 18, 0);
  1194.                     $count ++;
  1195.                 }
  1196.                 else
  1197.                 {
  1198.                     # quest::gmsay("GM: End of List", 18, 0);
  1199.                     $count = 0;
  1200.                 }
  1201.             }
  1202.             quest::popup("GUILD INSTANCE LIST","
  1203.                             Expires: $GetDays Day, $GetHours Hr, $GetMins Min, $GetSecs Sec <br>
  1204.                             <c \"#FE2E2E\">List of ($player_count) players in Guild Instance ($GID) in $zonesn<br>
  1205.                             &nbsp;<br>
  1206.                             $names_list
  1207.                             <br>
  1208.                             ",1050,0);
  1209.             $qglobals{"$Check_G_Invite"} = undef;
  1210.             $qglobals{"$Check_G_Leader"} = undef;
  1211.         }
  1212.         else { $client->Message(315,"You do not have a Guild Instance in $zonesn!"); }
  1213.         $qglobals{"$GuildInstanceID"} = undef;
  1214.     }
  1215.     # End Guild Instance LIST
  1216.     #################################################################################################################################################
  1217.  
  1218.  
  1219.     #################################################################################################################################################
  1220.     # List of players invited/assigned to Raid Instance
  1221.     if($text=~/^Raid List$/i)
  1222.     {
  1223.         # my $timestamp = localtime(time);
  1224.         $client->Message(315," ");
  1225.  
  1226.         # my $RaidID = $name;
  1227.         # QGLOBAL NAME LEADER OF RAID CAN SEE
  1228.         my $RaidInstanceID = "$name" . "_RaidI_" . "$zonesn" . "_" . "$zoneid";
  1229.  
  1230.         # RaidI_Group_7002_nro_34 - QGLOBAL NAME RAID GROUP MEMBER CAN SEE
  1231.         my $Check_G_Invite = "NA";
  1232.         my $Check_G_Leader = "NA";
  1233.         my $GID = 0;
  1234.         my $RaidGroup = $client->GetRaid();
  1235.  
  1236.         # Get info if part of Raid Group so can do Raid List
  1237.         if (defined($RaidGroup))
  1238.         {
  1239.             my $raidID = $RaidGroup->GetID();
  1240.             my $Raid_Group_Global_Name = "RaidI_Group_" . $raidID . "_$zonesn" . "_$zoneid";
  1241.             if (GET_QGLOBAL_VALUE($Raid_Group_Global_Name))
  1242.             {
  1243.                 $Check_G_Invite = GET_QGLOBAL_VALUE("$Raid_Group_Global_Name") . "_RaidI_" . $zonesn . "_" . "$zoneid";
  1244.                 $Check_G_Leader = GET_QGLOBAL_VALUE("$Raid_Group_Global_Name") . "_RaidI_Leader";
  1245.                 $GID = GET_QGLOBAL_VALUE("$Raid_Group_Global_Name");
  1246.             }
  1247.         }
  1248.  
  1249.         # Else if not in group, is the player the leader of non grouped raid?
  1250.         elsif (GET_QGLOBAL_VALUE("$RaidInstanceID"))
  1251.         {
  1252.             $Check_G_Invite = GET_QGLOBAL_VALUE("$RaidInstanceID") . "_RaidI_" . $zonesn . "_" . "$zoneid";
  1253.             $Check_G_Leader = GET_QGLOBAL_VALUE("$RaidInstanceID") . "_RaidI_Leader";
  1254.             $GID = GET_QGLOBAL_VALUE("$RaidInstanceID");
  1255.         }
  1256.  
  1257.         # Else not leader of raid and not member of raid group for current zone name
  1258.         else
  1259.         {
  1260.             # $client->Message(315,"You do not have (or are not leader of) a Raid Instance in $zonesn!"); # This message already used below
  1261.         }
  1262.  
  1263.         # If raid instance exist for either leader or raid group member in current zone, then do a list
  1264.         if ($GID > 0) # If we have a Guild Instance ID from either leader or raid group member, then show list
  1265.         {
  1266.             # OLD CODE TO JUST ALLOW LEADER OF RAID TO DO A LIST -- DELETE SOON
  1267.             # my $Check_G_Invite = GET_QGLOBAL_VALUE("$RaidInstanceID") . "_RaidI_" . $zonesn . "_" . "$zoneid";
  1268.             # my $Check_G_Leader = GET_QGLOBAL_VALUE("$RaidInstanceID") . "_RaidI_Leader";
  1269.             # my $GID = GET_QGLOBAL_VALUE("$RaidInstanceID");
  1270.  
  1271.             # GET TIME LEFT UNTIL INSTANCE EXPIRES
  1272.             my $LeaderTime  = $GID . "_RaidI_Time";
  1273.             my $ExpireTime  = GET_QGLOBAL_VALUE("$LeaderTime");
  1274.             my $TimeLeft    = $ExpireTime - time();
  1275.             my $GetDays     = int($TimeLeft/(24*60*60));
  1276.             my $GetHours    = ($TimeLeft/(60*60))%24;
  1277.             my $GetMins     = ($TimeLeft/60)%60;
  1278.             my $GetSecs     = $TimeLeft%60;
  1279.  
  1280.             $client->Message(315,"Expires: $GetDays Day, $GetHours Hr, $GetMins Min, $GetSecs Sec");
  1281.             $client->Message(315,"List of players in your Raid Instance ($GID) in $zonesn!");
  1282.             my $names_list = "";
  1283.             my $temp_name = "";
  1284.             my $raid_invite_name = $GID . "_RaidI_Status_";
  1285.             my $count = 1;
  1286.             my $player_count = 0;
  1287.             while ($count > 0)
  1288.             {
  1289.                 if (GET_QGLOBAL_VALUE("$raid_invite_name$count"))
  1290.                 {
  1291.                     $player_count = $count;
  1292.                     $temp_name = GET_QGLOBAL_VALUE("$raid_invite_name$count");
  1293.                     if ($temp_name=~/pending$/i)
  1294.                     {
  1295.                         my $player_name = $temp_name;
  1296.                         $player_name =~ s/_pending//; # string substitute flag
  1297.                         my $player_status = " - Pending";
  1298.                         my $yellow = "<c \"#AEB404\">";
  1299.                         my $white = "<c \"#FFFFFF\">";
  1300.                         my $player_space = "&nbsp;";
  1301.                         my $BR = "<br>";
  1302.                         my $player_number = "<c \"#0489B1\">$count : "; # Teal Color
  1303.                         $names_list = $names_list . $player_number . $white . $player_name . $yellow . $player_status . $BR;
  1304.                     }
  1305.                     elsif ($temp_name=~/joined$/i)
  1306.                     {
  1307.  
  1308.                         my $player_name = $temp_name;
  1309.                         $player_name =~ s/_joined//;
  1310.  
  1311.                         my $player_status = " - Joined";
  1312.                         my $green = "<c \"#298A08\">";
  1313.                         my $white = "<c \"#FFFFFF\">";
  1314.                         my $player_space = "&nbsp;";
  1315.                         my $BR = "<br>";
  1316.                         my $player_number = "<c \"#0489B1\">$count : "; # Teal Color
  1317.                         $names_list = $names_list . $player_number . $white . $player_name . $green . $player_status . $BR;
  1318.                     }
  1319.                     elsif ($temp_name=~/removed$/i)
  1320.                     {
  1321.                         my $player_name = $temp_name;
  1322.                         $player_name =~ s/_removed//;
  1323.                         my $player_status = " - Removed";
  1324.                         my $red = "<c \"#FE2E2E\">";
  1325.                         my $white = "<c \"#FFFFFF\">";
  1326.                         my $player_space = "&nbsp;";
  1327.                         my $BR = "<br>";
  1328.                         my $player_number = "<c \"#0489B1\">$count : "; # Teal Color
  1329.                         $names_list = $names_list . $player_number . $white . $player_name . $red . $player_status . $BR;
  1330.                     }
  1331.                     else
  1332.                     {
  1333.                         quest::gmsay("GM: RAID LIST ADD NAME ERROR.", 18, 0);
  1334.                     }
  1335.                     # quest::gmsay("GM: $temp_name added to List", 18, 0);
  1336.                     $count ++;
  1337.                 }
  1338.                 else
  1339.                 {
  1340.                     # quest::gmsay("GM: End of List", 18, 0);
  1341.                     $count = 0;
  1342.                 }
  1343.             }
  1344.             quest::popup("RAID INSTANCE LIST","
  1345.                             Expires: $GetDays Day, $GetHours Hr, $GetMins Min, $GetSecs Sec <br>
  1346.                             <c \"#FE2E2E\">List of ($player_count) players in Raid Instance ($GID) in $zonesn<br>
  1347.                             &nbsp;<br>
  1348.                             $names_list
  1349.                             <br>
  1350.                             ",1050,0);
  1351.             $qglobals{"$Check_G_Invite"} = undef;
  1352.             $qglobals{"$Check_G_Leader"} = undef;
  1353.         }
  1354.         else
  1355.         {
  1356.             $client->Message(315,"You do not have (or are not leader of) a Raid Instance in $zonesn!");
  1357.             # $client->Message(315,"GID = $GID");
  1358.         }
  1359.         $qglobals{"$RaidInstanceID"} = undef;
  1360.     }
  1361.     # End Raid Instance LIST
  1362.     #################################################################################################################################################
  1363.  
  1364.  
  1365.     if($text=~/^More Options$/i)
  1366.     {
  1367.         # $client->Message(315, " ");
  1368.         my $GuildInvite     = quest::saylink("Guild Invite", 1);
  1369.         my $GuildJoin       = quest::saylink("Guild Join", 1);
  1370.         my $GuildRemove     = quest::saylink("Guild Remove", 1);
  1371.         my $RaidInvite      = quest::saylink("Raid Invite", 1);
  1372.         my $RaidJoin        = quest::saylink("Raid Join", 1);
  1373.         my $RaidRemove      = quest::saylink("Raid Remove", 1);
  1374.         my $Deposit = quest::saylink("Deposit",1);
  1375.         my $Withdraw = quest::saylink("Withdraw",1);
  1376.         my $Balance = quest::saylink("Balance",1);
  1377.         $client->Message(315, "More Waypoint Options ...");
  1378.         $client->Message(315, "[$RaidInvite] [$RaidJoin] [$RaidRemove]");
  1379.         $client->Message(315, "[$GuildInvite] [$GuildJoin] [$GuildRemove]");
  1380.         $client->Message(315, "[$Balance] [$Deposit] [$Withdraw]");
  1381.     }
  1382.  
  1383.  
  1384.     if($text =~ /^Balance$/i)
  1385.     {
  1386.         # plugin::CreditStatusAccount("BankCredit");
  1387.         Check_Balance("BankCredit");
  1388.     }
  1389.  
  1390.  
  1391.     if($text =~ /^Deposit$/i)
  1392.     {
  1393.         $client->Message(315," ");
  1394.         $client->Message(315,"Just give a Waypoint any amount of platinum you'd like to deposit!");
  1395.     }
  1396.  
  1397.     if($text =~ /^Withdraw$/i)
  1398.     {
  1399.         $client->Message(315," ");
  1400.         $client->Message(315,"Withdraw not available.");
  1401.     }
  1402.  
  1403.  
  1404.     if($text=~/^Leave Instance$/i)
  1405.     {
  1406.         my $Cx = $client->GetX();
  1407.         my $Cy = $client->GetY();
  1408.         my $Cz = $client->GetZ();
  1409.         my $Ch = $client->GetHeading();
  1410.         my $timestamp = localtime(time);
  1411.         $client->Message(315," ");
  1412.         $client->Message(315,"Moving you back to public zone in $zonesn!");
  1413.         quest::popup("LEAVE INSTANCE","<br>
  1414.                             <c \"#FE2E2E\">You choose to leave instance.<br>
  1415.                             <c \"#FE2E2E\">Moving you to a PUBLIC zone!<br>
  1416.                             <br>
  1417.                             <c \"#FFFF49\">Time : &nbsp;&nbsp;&nbsp;<c \"#00FF00\">$timestamp<br>
  1418.                             <c \"#FFFF49\">Name : &nbsp; <c \"#00FF00\">$name<br>
  1419.                             <c \"#FFFF49\">Zone : &nbsp;&nbsp;&nbsp; <c \"#00FF00\">$zonesn<br>
  1420.                             <c \"#FFFF49\">Type : &nbsp;&nbsp;&nbsp;&nbsp; <c \"#00FF00\">Public<br>
  1421.                             <br>
  1422.                             <c \"#00BFFF\">ENJOY!<br>
  1423.                             <br>
  1424.                             ",1050,0);
  1425.         quest::movepc($zoneid, $Cx, $Cy, $Cz, $Ch);
  1426.     }
  1427.  
  1428. } # End SPAM DELAY
  1429. } # End EVENT_SAY
  1430.  
  1431.  
  1432. sub EVENT_SIGNAL
  1433. {
  1434.  
  1435.     quest::gmsay("GM: $signal", 18, 0);
  1436.  
  1437.     # 1000000000 is to remove player from Guild and Raid Instances (1,000,000,000)
  1438.     my $signal_ID = 0;
  1439.     my $signal_zone_ID = 0;
  1440.     my $signal_instance_ID = 0;
  1441.  
  1442.     if ($signal > 1000000000)
  1443.     {
  1444.         $signal_ID = $signal - 1000000000;              # If remove player from instance flag, use signal - 1 BILLION
  1445.     }
  1446.     else
  1447.     {
  1448.         $signal_ID = $signal;                           # else no remove flag, just use signal
  1449.     }
  1450.     $signal_zone_ID = int ($signal_ID / 1000000);       # Before signal sent, was: $ZoneConvert = $zoneid * 1000000;
  1451.     $signal_instance_ID = int ($signal_ID % 1000000);
  1452.  
  1453.     my $zone_name = GET_ZONE_NAME_BY_ID($signal_zone_ID);
  1454.     my $Check_G_Invite = $signal_instance_ID . "_GuildI_" . $zone_name . "_" . "$signal_zone_ID";
  1455.     my $Check_G_Leader = $signal_instance_ID . "_GuildI_Leader";
  1456.     my $Check_R_Invite = $signal_instance_ID . "_RaidI_" . $zone_name . "_" . "$signal_zone_ID";
  1457.     my $Check_R_Leader = $signal_instance_ID . "_RaidI_Leader";
  1458.  
  1459.     #############################################################################################################################
  1460.     # IF GUILD INVITE ###########################################################################################################
  1461.     if (GET_QGLOBAL_VALUE("$Check_G_Invite"))
  1462.     {
  1463.         my $Leader = GET_QGLOBAL_VALUE("$Check_G_Leader");
  1464.         quest::AssignToInstance($signal_instance_ID);
  1465.  
  1466.         # Create a qglobal list of players invited/assigned to Guild Instance
  1467.         my $count = 1;
  1468.         my $guild_invite_name       = $signal_instance_ID . "_GuildI_Status_";
  1469.         my $guild_invite_pending    = $name . "_pending";
  1470.         my $guild_invite_joined     = $name . "_joined";
  1471.         my $guild_invite_removed    = $name . "_removed";
  1472.         while ($count > 0)
  1473.         {
  1474.             if (GET_QGLOBAL_VALUE("$guild_invite_name$count"))
  1475.             {
  1476.                 if (GET_QGLOBAL_VALUE("$guild_invite_name$count") eq $guild_invite_pending ||
  1477.                     GET_QGLOBAL_VALUE("$guild_invite_name$count") eq $guild_invite_joined)
  1478.                 {
  1479.                     if ($signal > 1000000000)
  1480.                     {
  1481.                         my $Cx = $client->GetX();
  1482.                         my $Cy = $client->GetY();
  1483.                         my $Cz = $client->GetZ();
  1484.                         my $Ch = $client->GetHeading();
  1485.                         my $timestamp = localtime(time);
  1486.                         $client->Message(315," ");
  1487.                         $client->Message(315,"You have been removed from $Leader Guild Instance ($signal_instance_ID) in $zone_name!");
  1488.                         quest::popup("YOU HAVE BEEN REMOVED","<br>
  1489.                             <c \"#FE2E2E\">You have been removed from $Leader Guild Instance.<br>
  1490.                             <c \"#FE2E2E\">Moving you to a PUBLIC zone!<br>
  1491.                             <br>
  1492.                             <c \"#FFFF49\">Time : &nbsp;&nbsp;&nbsp;<c \"#00FF00\">$timestamp<br>
  1493.                             <c \"#FFFF49\">Name : &nbsp; <c \"#00FF00\">$name<br>
  1494.                             <c \"#FFFF49\">Zone : &nbsp;&nbsp;&nbsp; <c \"#00FF00\">$zone_name<br>
  1495.                             <c \"#FFFF49\">Type : &nbsp;&nbsp;&nbsp;&nbsp; <c \"#00FF00\">Public<br>
  1496.                             <br>
  1497.                             <c \"#00BFFF\">You have been removed from Guild Instance ($signal_instance_ID) in $zone_name!<br>
  1498.                             <br>
  1499.                             ",1050,0);
  1500.                         my $GetSeconds = GET_TIME_LEFT("GUILD", $signal_instance_ID);
  1501.                         quest::setglobal("$guild_invite_name$count","$guild_invite_removed","7","S$GetSeconds");
  1502.                         $count = 0;
  1503.                         if ($signal_zone_ID == $zoneid)
  1504.                         {
  1505.                             $client->Message(315,"Zoning you out of $zonesn.");
  1506.                             quest::movepc($zoneid, $Cx, $Cy, $Cz, $Ch); # If current zone = same name for instance, then move to public
  1507.                         }
  1508.                         else
  1509.                         {
  1510.                             $client->Message(315,"You have already zoned out of $zone_name.");
  1511.                         }
  1512.                     }
  1513.                     else
  1514.                     {
  1515.                         my $GetSeconds = GET_TIME_LEFT("GUILD", $signal_instance_ID);
  1516.                         my $correct_zone = GET_ZONE_NAME_BY_ID($signal_zone_ID);
  1517.                         quest::setglobal("$guild_invite_name$count","$guild_invite_pending","7","S$GetSeconds");
  1518.                         $client->Message(315," ");
  1519.                         $client->Message(315,"$Leader has re-invited you to join a Guild Instance in $correct_zone.");
  1520.                         $client->Message(315,"Type: guild join $Leader (when you are in $correct_zone)");
  1521.                     }
  1522.                     $count = 0;
  1523.                 }
  1524.                 elsif (GET_QGLOBAL_VALUE("$guild_invite_name$count") eq $guild_invite_removed)
  1525.                 {
  1526.                     if ($signal < 1000000000)
  1527.                     {
  1528.                         my $GetSeconds = GET_TIME_LEFT("GUILD", $signal_instance_ID);
  1529.                         my $correct_zone = GET_ZONE_NAME_BY_ID($signal_zone_ID);
  1530.                         quest::setglobal("$guild_invite_name$count","$guild_invite_pending","7","S$GetSeconds");
  1531.                         $client->Message(315," ");
  1532.                         $client->Message(315,"$Leader has re-invited you to join a Guild Instance in $correct_zone.");
  1533.                         $client->Message(315,"Type: guild join $Leader (when you are in $correct_zone)");
  1534.                     }
  1535.                     $count = 0;
  1536.                 }
  1537.                 else
  1538.                 {
  1539.                     $count ++;
  1540.                 }
  1541.             }
  1542.             else
  1543.             {
  1544.                 ###############################################################################
  1545.                 my $GetSeconds = GET_TIME_LEFT("GUILD", $signal_instance_ID);
  1546.                 my $correct_zone = GET_ZONE_NAME_BY_ID($signal_zone_ID);
  1547.                 quest::setglobal("$guild_invite_name$count","$guild_invite_pending","7","S$GetSeconds");
  1548.                 $client->Message(315," ");
  1549.                 $client->Message(315,"$Leader has invited you to join a Guild Instance in $correct_zone.");
  1550.                 $client->Message(315,"Type: guild join $Leader (when you are in $correct_zone)");
  1551.                 $count = 0;
  1552.             }
  1553.         }
  1554.         $qglobals{"$Check_G_Invite"} = undef;
  1555.         $qglobals{"$Check_G_Leader"} = undef;
  1556.     }
  1557.     # END IF GUILD INVITE #######################################################################################################
  1558.     #############################################################################################################################
  1559.  
  1560.  
  1561.     #############################################################################################################################
  1562.     # IF RAID INVITE ############################################################################################################
  1563.     if (GET_QGLOBAL_VALUE("$Check_R_Invite"))
  1564.     {
  1565.         my $Leader = GET_QGLOBAL_VALUE("$Check_R_Leader");
  1566.         quest::AssignToInstance($signal_instance_ID);
  1567.  
  1568.         # Create a qglobal list of players invited/assigned to Raid Instance
  1569.         my $count = 1;
  1570.         my $raid_invite_name        = $signal_instance_ID . "_RaidI_Status_";
  1571.         my $raid_invite_pending     = $name . "_pending";
  1572.         my $raid_invite_joined      = $name . "_joined";
  1573.         my $raid_invite_removed     = $name . "_removed";
  1574.         while ($count > 0)
  1575.         {
  1576.             if (GET_QGLOBAL_VALUE("$raid_invite_name$count"))
  1577.             {
  1578.                 if (GET_QGLOBAL_VALUE("$raid_invite_name$count") eq $raid_invite_pending ||
  1579.                     GET_QGLOBAL_VALUE("$raid_invite_name$count") eq $raid_invite_joined)
  1580.                 {
  1581.                     if ($signal > 1000000000)
  1582.                     {
  1583.                         my $Cx = $client->GetX();
  1584.                         my $Cy = $client->GetY();
  1585.                         my $Cz = $client->GetZ();
  1586.                         my $Ch = $client->GetHeading();
  1587.                         my $timestamp = localtime(time);
  1588.                         $client->Message(315," ");
  1589.                         $client->Message(315,"You have been removed from $Leader Raid Instance ($signal_instance_ID) in $zone_name!");
  1590.                         quest::popup("YOU HAVE BEEN REMOVED","<br>
  1591.                             <c \"#FE2E2E\">You have been removed from $Leader Raid Instance.<br>
  1592.                             <c \"#FE2E2E\">Moving you to a PUBLIC zone!<br>
  1593.                             <br>
  1594.                             <c \"#FFFF49\">Time : &nbsp;&nbsp;&nbsp;<c \"#00FF00\">$timestamp<br>
  1595.                             <c \"#FFFF49\">Name : &nbsp; <c \"#00FF00\">$name<br>
  1596.                             <c \"#FFFF49\">Zone : &nbsp;&nbsp;&nbsp; <c \"#00FF00\">$zone_name<br>
  1597.                             <c \"#FFFF49\">Type : &nbsp;&nbsp;&nbsp;&nbsp; <c \"#00FF00\">Public<br>
  1598.                             <br>
  1599.                             <c \"#00BFFF\">You have been removed from Raid Instance ($signal_instance_ID) in $zone_name!<br>
  1600.                             <br>
  1601.                             ",1050,0);
  1602.                         my $GetSeconds = GET_TIME_LEFT("RAID", $signal_instance_ID);
  1603.                         quest::setglobal("$raid_invite_name$count","$raid_invite_removed","7","S$GetSeconds");
  1604.                         $count = 0;
  1605.                         if ($signal_zone_ID == $zoneid)
  1606.                         {
  1607.                             $client->Message(315,"Zoning you out of $zonesn.");
  1608.                             quest::movepc($zoneid, $Cx, $Cy, $Cz, $Ch); # If current zone = same name for instance, then move to public
  1609.                         }
  1610.                         else
  1611.                         {
  1612.                             $client->Message(315,"You have already zoned out of $zone_name.");
  1613.                         }
  1614.                     }
  1615.                     else
  1616.                     {
  1617.                         my $GetSeconds = GET_TIME_LEFT("RAID", $signal_instance_ID);
  1618.                         my $correct_zone = GET_ZONE_NAME_BY_ID($signal_zone_ID);
  1619.                         quest::setglobal("$raid_invite_name$count","$raid_invite_pending","7","S$GetSeconds");
  1620.                         $client->Message(315," ");
  1621.                         $client->Message(315,"$Leader has re-invited you to join a Raid Instance in $zone_name.");
  1622.                         $client->Message(315,"Type: raid join $Leader (when you are in $correct_zone)");
  1623.                     }
  1624.                     $count = 0;
  1625.                 }
  1626.                 elsif (GET_QGLOBAL_VALUE("$raid_invite_name$count") eq $raid_invite_removed)
  1627.                 {
  1628.                     if ($signal < 1000000000)
  1629.                     {
  1630.                         my $GetSeconds = GET_TIME_LEFT("RAID", $signal_instance_ID);
  1631.                         my $correct_zone = GET_ZONE_NAME_BY_ID($signal_zone_ID);
  1632.                         quest::setglobal("$raid_invite_name$count","$raid_invite_pending","7","S$GetSeconds");
  1633.                         $client->Message(315," ");
  1634.                         $client->Message(315,"$Leader has re-invited you to join a Raid Instance in $zone_name.");
  1635.                         $client->Message(315,"Type: raid join $Leader (when you are in $correct_zone)");
  1636.                     }
  1637.                     $count = 0;
  1638.                 }
  1639.                 else
  1640.                 {
  1641.                     $count ++;
  1642.                 }
  1643.             }
  1644.             else
  1645.             {
  1646.                 ###############################################################################
  1647.                 my $GetSeconds = GET_TIME_LEFT("RAID", $signal_instance_ID);
  1648.                 my $correct_zone = GET_ZONE_NAME_BY_ID($signal_zone_ID);
  1649.                 quest::setglobal("$raid_invite_name$count","$raid_invite_pending","7","S$GetSeconds");
  1650.                 $client->Message(315," ");
  1651.                 $client->Message(315,"$Leader has invited you to join a Raid Instance in $zone_name.");
  1652.                 $client->Message(315,"Type: raid join $Leader (when you are in $correct_zone)");
  1653.                 $count = 0;
  1654.             }
  1655.         }
  1656.         $qglobals{"$Check_R_Invite"} = undef;
  1657.         $qglobals{"$Check_R_Leader"} = undef;
  1658.     }
  1659.     # END IF RAID INVITE ########################################################################################################
  1660.     #############################################################################################################################
  1661.  
  1662. } # End EVENT_SIGNAL
  1663.  
  1664.  
  1665. #################################################################################################################################
  1666. ####   CUSTOM SUBS   ############################################################################################################
  1667. #################################################################################################################################
  1668.  
  1669.  
  1670. ### Usage: PayInstance("Creditname", Cost, "Solo/Guild/Raid");
  1671. ### This will take into account the whole account of the player
  1672. sub PayInstance
  1673. {
  1674.     my $CreditName = $_[0];
  1675.     my $Cost = $_[1];
  1676.     my $Instance_Type = $_[2]; # Solo, Guild, or Raid
  1677.     my $client = plugin::val('$client');
  1678.     my $name = plugin::val('$name');
  1679.     my $zonesn = plugin::val('$zonesn');
  1680.     my $qglobals = plugin::var('qglobals');
  1681.     my $space = "_";
  1682.     my $accountid = $client->AccountID();
  1683.     my $accountname = $client->AccountName();
  1684.     # my $CreditAmnt = GET_QGLOBAL_VALUE("$CreditName$space$accountid");
  1685.     my $CreditAmnt = GET_QGLOBAL_VALUE("$CreditName$space$accountid");
  1686.     my $CreditAmnt2 = commify2($CreditAmnt - $Cost);
  1687.     my $CostCommify = commify2($Cost);
  1688.     if ($CreditAmnt < $Cost)
  1689.     {
  1690.         $client->Message(315,"Insuffient funds... You need " . ($Cost - $CreditAmnt) . " more Platinum pieces.");
  1691.     }
  1692.     else
  1693.     {
  1694.         $CreditAmnt -= $Cost;
  1695.         $client->SetGlobal("$CreditName$space$accountid", "$CreditAmnt", 7, 'F');
  1696.         $client->Message(315," ");
  1697.         $client->Message(315,"You now have $CreditAmnt2 platinum left.");
  1698.         my $ClientCheck = PlayerClientCheck();
  1699.         my $timestamp = localtime(time);
  1700.         quest::popup("Account Balance","
  1701.             <c \"#FFFF66\">Time : </c> $timestamp </c> <br>
  1702.             <c \"#FFFF66\">Client : </c> $ClientCheck </c> <br>
  1703.             <c \"#FFFF66\">Account : </c> $accountname <br>
  1704.             <c \"#FFFF66\">Character : </c>$name <br>
  1705.             <c \"#FFFF66\">Zone Name : </c>$zonesn <br>
  1706.             <c \"#FFFF66\">Instance Type : </c>$Instance_Type <br>
  1707.             <c \"#FFFF66\">Cost from Account : </c>  <c \"#FE2E2E</c> - $CostCommify </c> <br>
  1708.             <c \"#FFFF66\">Remaining Balance : </c> <c \"#33FF99\"> $CreditAmnt2 </c> <br>
  1709.             <br>
  1710.             <c \"#FE2E2E\">WARNING:  </c> Like other <c \"#FFFF66\">Qglobals</c>, sometimes the zone will bug out
  1711.             and not see the current values. If your balance or instance has disappeared, try going to a public zone
  1712.             or different zone to see if it gets refresh.
  1713.             We apologize for the inconvenience as it will reappear in time.
  1714.             ");
  1715.     }
  1716.     $qglobals{"$CreditName$space$accountid"} = undef;
  1717. } # End PayInstance
  1718.  
  1719.  
  1720. ### POP UP TO DISPLAY WAYPOINT BALANCE
  1721. sub Check_Balance
  1722. {
  1723.     my $CreditName = $_[0];
  1724.     my $client = plugin::val('$client');
  1725.     my $name = plugin::val('$name');
  1726.     my $zonesn = plugin::val('$zonesn');
  1727.     my $qglobals = plugin::var('qglobals');
  1728.     my $space = "_";
  1729.     my $accountid = $client->AccountID();
  1730.     my $accountname = $client->AccountName();
  1731.     # my $CreditAmnt = GET_QGLOBAL_VALUE("$CreditName$space$accountid");
  1732.     my $CreditAmnt = GET_QGLOBAL_VALUE("$CreditName$space$accountid");
  1733.     my $CreditAmnt2 = commify2($CreditAmnt);
  1734.     # my $CreditAmnt2 = $CreditAmnt - $Cost;
  1735.     my $ClientCheck = PlayerClientCheck();
  1736.     my $timestamp = localtime(time);
  1737.     quest::popup("Account Balance","
  1738.             <c \"#FFFF66\">Time : </c> $timestamp </c> <br>
  1739.             <c \"#FFFF66\">Client : </c> $ClientCheck </c> <br>
  1740.             <c \"#FFFF66\">Account : </c> $accountname <br>
  1741.             <c \"#FFFF66\">Character : </c>$name <br>
  1742.             <c \"#FFFF66\">Zone Name : </c>$zonesn <br>
  1743.             <c \"#FFFF66\">Remaining Balance : </c> <c \"#33FF99\"> $CreditAmnt2 </c> <br>
  1744.             <br>
  1745.             <c \"#FE2E2E\">WARNING:  </c> Like other <c \"#FFFF66\">Qglobals</c> , sometimes the zone will bug out
  1746.             and not see the current values. If your balance or instance has disappeared, try going to a public zone
  1747.             or different zone to see if it gets refresh.
  1748.             We apologize for the inconvenience as it will reappear in time.
  1749.             ");
  1750.     $client->Message(315," ");
  1751.     $client->Message(315,"You now have $CreditAmnt2 platinum left.");
  1752.     $qglobals{"$CreditName$space$accountid"} = undef;
  1753. } # End Check_Balance
  1754.  
  1755.  
  1756. ### Check Expansion Name
  1757. sub PlayerClientCheck
  1758. {
  1759.     my $client = plugin::val('$client');
  1760.     my $clientver = $client->GetClientVersion();
  1761.     my $ShowClient = "";
  1762.     if      ($clientver == 2)   { $ShowClient = "Titanium"; }
  1763.     elsif   ($clientver == 3)   { $ShowClient = "Secrets of Faydwer"; }
  1764.     elsif   ($clientver == 4)   { $ShowClient = "Seeds of Destruction"; }
  1765.     elsif   ($clientver == 5)   { $ShowClient = "Underfoot"; }
  1766.     else                        { $ShowClient = "Other"; }
  1767.     return "$ShowClient";
  1768. }
  1769.  
  1770.  
  1771. ### Change 1000000 to 1,000,000
  1772. sub commify2
  1773. {
  1774.    local $_  = shift;
  1775.    s{(?<!\d|\.)(\d{4,})}
  1776.     {my $n = $1;
  1777.      $n=~s/(?<=.)(?=(?:.{3})+$)/,/g;
  1778.      $n;
  1779.     }eg;
  1780.    return $_;
  1781. }
  1782.  
  1783.  
  1784. sub SOLO_PRICE
  1785. {
  1786.     my $client = plugin::val('$client');
  1787.     my $freeinstance = plugin::check_hasitem($client, 120003);  #EDIT item ID for FREE instance item
  1788.     my $paidinstance = plugin::check_hasitem($client, 119998);  #EDIT item ID for PAID instance item
  1789.     my $new_price = 1000;
  1790.  
  1791.     if      ($freeinstance) { $new_price = 0; }
  1792.     elsif   ($paidinstance) {
  1793.                                 # $new_price = 1000;
  1794.                                 if ($zonesn eq "trakanon" ||
  1795.                                     $zonesn eq "permafrost" ||
  1796.                                     $zonesn eq "dalnir" ||
  1797.                                     $zonesn eq "velketor" ||
  1798.                                     $zonesn eq "eastkarana" ||
  1799.                                     $zonesn eq "highpasshold" ||
  1800.                                     $zonesn eq "highpass" ||
  1801.                                     $zonesn eq "unrest" ||
  1802.                                     $zonesn eq "crushbone" ||
  1803.                                     $zonesn eq "sebilis" ||
  1804.                                     $zonesn eq "lakerathe" ||
  1805.                                     $zonesn eq "soldungb" ||
  1806.                                     $zonesn eq "citymist" ||
  1807.                                     $zonesn eq "qeytoqrg" ||
  1808.                                     $zonesn eq "mistmoore" ||
  1809.                                     $zonesn eq "steamfont" ||
  1810.                                     $zonesn eq "gukbottom" ||
  1811.                                     $zonesn eq "oot" ||
  1812.                                     $zonesn eq "najena" ||
  1813.                                     $zonesn eq "befallen")
  1814.                                                                 { $new_price  = 5000; }
  1815.                                 if ($zonesn eq "postorms")      { $new_price  = 25000; }
  1816.                                 if ($zonesn eq "hohonora")      { $new_price  = 50000; }
  1817.                                 if ($zonesn eq "illsalin")      { $new_price  = 75000; }
  1818.                                 if ($zonesn eq "anguish")       { $new_price  = 100000; }
  1819.                                 if ($zonesn eq "lopingplains")  { $new_price  = 125000; }
  1820.                                 if ($zonesn eq "frozenshadow")  { $new_price  = 999999999; }
  1821.                             }
  1822.     else                    { $new_price = 50000000; } # 50 Million Plat for not having a 1 Million Plat Waypoint Clickie
  1823.  
  1824.     $new_price = 0; # FREE WHILE TESTING!
  1825.  
  1826.     # DISABLED ZONES
  1827.     if ($zonesn eq "overthere")     { $new_price  = 999999999; } # Due to Custom PvP Area
  1828.     if ($zonesn eq "commons")       { $new_price  = 999999999; } # Due to Custom PvP Area
  1829.  
  1830.     return $new_price;
  1831. }
  1832.  
  1833.  
  1834. sub GUILD_PRICE
  1835. {
  1836.     my $freeinstance = plugin::check_hasitem($client, 120003);  #EDIT item ID for FREE instance item
  1837.     my $paidinstance = plugin::check_hasitem($client, 119998);  #EDIT item ID for PAID instance item
  1838.     my $new_price = 5000;
  1839.  
  1840.     if      ($freeinstance) { $new_price = 0; }
  1841.     elsif   ($paidinstance) {
  1842.                                 # $new_price = 3000;
  1843.                                 if ($zonesn eq "trakanon" ||
  1844.                                     $zonesn eq "permafrost" ||
  1845.                                     $zonesn eq "dalnir" ||
  1846.                                     $zonesn eq "velketor" ||
  1847.                                     $zonesn eq "eastkarana" ||
  1848.                                     $zonesn eq "highpasshold" ||
  1849.                                     $zonesn eq "highpass" ||
  1850.                                     $zonesn eq "unrest" ||
  1851.                                     $zonesn eq "crushbone" ||
  1852.                                     $zonesn eq "sebilis" ||
  1853.                                     $zonesn eq "lakerathe" ||
  1854.                                     $zonesn eq "soldungb" ||
  1855.                                     $zonesn eq "citymist" ||
  1856.                                     $zonesn eq "qeytoqrg" ||
  1857.                                     $zonesn eq "mistmoore" ||
  1858.                                     $zonesn eq "steamfont" ||
  1859.                                     $zonesn eq "gukbottom" ||
  1860.                                     $zonesn eq "oot" ||
  1861.                                     $zonesn eq "najena" ||
  1862.                                     $zonesn eq "befallen")
  1863.                                                                 { $new_price  = 10000; }
  1864.                                 if ($zonesn eq "postorms")      { $new_price  = 50000; }
  1865.                                 if ($zonesn eq "hohonora")      { $new_price  = 75000; }
  1866.                                 if ($zonesn eq "illsalin")      { $new_price  = 250000; }
  1867.                                 if ($zonesn eq "anguish")       { $new_price  = 350000; }
  1868.                                 if ($zonesn eq "lopingplains")  { $new_price  = 500000; }
  1869.                                 if ($zonesn eq "frozenshadow")  { $new_price  = 999999999; }
  1870.                             }
  1871.     else                    { $new_price = 50000000; } # 50 Million Plat for not having a 1 Million Plat Waypoint Clickie
  1872.  
  1873.     $new_price = 0; # FREE WHILE TESTING!
  1874.  
  1875.     # DISABLED ZONES
  1876.     if ($zonesn eq "overthere")     { $new_price  = 999999999; } # Due to Custom PvP Area
  1877.     if ($zonesn eq "commons")       { $new_price  = 999999999; } # Due to Custom PvP Area
  1878.  
  1879.     return $new_price;
  1880. }
  1881.  
  1882.  
  1883. sub RAID_PRICE
  1884. {
  1885.     my $freeinstance = plugin::check_hasitem($client, 120003);  #EDIT item ID for FREE instance item
  1886.     my $paidinstance = plugin::check_hasitem($client, 119998);  #EDIT item ID for PAID instance item
  1887.     my $new_price = 5000;
  1888.  
  1889.     if      ($freeinstance) { $new_price = 0; }
  1890.     elsif   ($paidinstance) {
  1891.                                 # $new_price = 5000;
  1892.                                 if ($zonesn eq "trakanon" ||
  1893.                                     $zonesn eq "permafrost" ||
  1894.                                     $zonesn eq "dalnir" ||
  1895.                                     $zonesn eq "velketor" ||
  1896.                                     $zonesn eq "eastkarana" ||
  1897.                                     $zonesn eq "highpasshold" ||
  1898.                                     $zonesn eq "highpass" ||
  1899.                                     $zonesn eq "unrest" ||
  1900.                                     $zonesn eq "crushbone" ||
  1901.                                     $zonesn eq "sebilis" ||
  1902.                                     $zonesn eq "lakerathe" ||
  1903.                                     $zonesn eq "soldungb" ||
  1904.                                     $zonesn eq "citymist" ||
  1905.                                     $zonesn eq "qeytoqrg" ||
  1906.                                     $zonesn eq "mistmoore" ||
  1907.                                     $zonesn eq "steamfont" ||
  1908.                                     $zonesn eq "gukbottom" ||
  1909.                                     $zonesn eq "oot" ||
  1910.                                     $zonesn eq "najena" ||
  1911.                                     $zonesn eq "befallen")
  1912.                                                                 { $new_price  = 10000; }
  1913.                                 if ($zonesn eq "postorms")      { $new_price  = 50000; }
  1914.                                 if ($zonesn eq "hohonora")      { $new_price  = 75000; }
  1915.                                 if ($zonesn eq "illsalin")      { $new_price  = 250000; }
  1916.                                 if ($zonesn eq "anguish")       { $new_price  = 350000; }
  1917.                                 if ($zonesn eq "lopingplains")  { $new_price  = 500000; }
  1918.                                 if ($zonesn eq "frozenshadow")  { $new_price  = 999999999; }
  1919.                             }
  1920.     else                    { $new_price = 50000000; } # 50 Million Plat for not having a 1 Million Plat Waypoint Clickie
  1921.  
  1922.     $new_price = 0; # FREE WHILE TESTING!
  1923.  
  1924.     # DISABLED ZONES
  1925.     if ($zonesn eq "overthere")     { $new_price  = 999999999; } # Due to Custom PvP Area
  1926.     if ($zonesn eq "commons")       { $new_price  = 999999999; } # Due to Custom PvP Area
  1927.  
  1928.     return $new_price;
  1929. }
  1930.  
  1931.  
  1932. ### Gets the amount of time left for the instance so we can sync/set qglobal expire times
  1933. ### for invited player (on list) qglobal and leader created instance qglobal to expire at same time
  1934. sub GET_TIME_LEFT
  1935. {
  1936.     my $instance_type   = $_[0]; # IS IT "GUILD" OR "RAID" TYPE?
  1937.     my $InstID          = $_[1]; # ID OF INSTANCE
  1938.     my $TimeName        = "";
  1939.     my $qglobals        = plugin::var('qglobals');
  1940.     my $LeaderTime      = "";
  1941.     my $ExpireTime      = 0;
  1942.     my $TimeLeft        = 0;
  1943.  
  1944.     if ($instance_type eq "RAID")   { $TimeName = "_RaidI_Time"; }
  1945.     if ($instance_type eq "GUILD")  { $TimeName = "_GuildI_Time"; }
  1946.     $LeaderTime = $InstID . $TimeName;
  1947.     if (GET_QGLOBAL_VALUE("$LeaderTime"))
  1948.     {
  1949.         $ExpireTime = GET_QGLOBAL_VALUE("$LeaderTime");
  1950.         $TimeLeft = $ExpireTime - time();
  1951.     }
  1952.  
  1953.     return $TimeLeft
  1954. }
  1955.  
  1956.  
  1957. sub GET_ZONE_NAME_BY_ID
  1958. {
  1959.     if ($_[0] == 0) { return("Invalid Zone"); }
  1960.     elsif ($_[0] == 1) { return("qeynos"); }
  1961.     elsif ($_[0] == 2) { return("qeynos2"); }
  1962.     elsif ($_[0] == 3) { return("qrg"); }
  1963.     elsif ($_[0] == 4) { return("qeytoqrg"); }
  1964.     elsif ($_[0] == 5) { return("highpass"); }
  1965.     elsif ($_[0] == 6) { return("highkeep"); }
  1966.     elsif ($_[0] == 8) { return("freportn"); }
  1967.     elsif ($_[0] == 9) { return("freportw"); }
  1968.     elsif ($_[0] == 10) { return("freporte"); }
  1969.     elsif ($_[0] == 11) { return("runnyeye"); }
  1970.     elsif ($_[0] == 12) { return("qey2hh1"); }
  1971.     elsif ($_[0] == 13) { return("northkarana"); }
  1972.     elsif ($_[0] == 14) { return("southkarana"); }
  1973.     elsif ($_[0] == 15) { return("eastkarana"); }
  1974.     elsif ($_[0] == 16) { return("beholder"); }
  1975.     elsif ($_[0] == 17) { return("blackburrow"); }
  1976.     elsif ($_[0] == 18) { return("paw"); }
  1977.     elsif ($_[0] == 19) { return("rivervale"); }
  1978.     elsif ($_[0] == 20) { return("kithicor"); }
  1979.     elsif ($_[0] == 21) { return("commons"); }
  1980.     elsif ($_[0] == 22) { return("ecommons"); }
  1981.     elsif ($_[0] == 23) { return("erudnint"); }
  1982.     elsif ($_[0] == 24) { return("erudnext"); }
  1983.     elsif ($_[0] == 25) { return("nektulos"); }
  1984.     elsif ($_[0] == 25) { return("nektulos"); }
  1985.     elsif ($_[0] == 26) { return("cshome"); }
  1986.     elsif ($_[0] == 27) { return("lavastorm"); }
  1987.     elsif ($_[0] == 28) { return("nektropos"); }
  1988.     elsif ($_[0] == 29) { return("halas"); }
  1989.     elsif ($_[0] == 30) { return("everfrost"); }
  1990.     elsif ($_[0] == 31) { return("soldunga"); }
  1991.     elsif ($_[0] == 32) { return("soldungb"); }
  1992.     elsif ($_[0] == 33) { return("misty"); }
  1993.     elsif ($_[0] == 34) { return("nro"); }
  1994.     elsif ($_[0] == 35) { return("sro"); }
  1995.     elsif ($_[0] == 36) { return("befallen"); }
  1996.     elsif ($_[0] == 37) { return("oasis"); }
  1997.     elsif ($_[0] == 38) { return("tox"); }
  1998.     elsif ($_[0] == 39) { return("hole"); }
  1999.     elsif ($_[0] == 40) { return("neriaka"); }
  2000.     elsif ($_[0] == 41) { return("neriakb"); }
  2001.     elsif ($_[0] == 42) { return("neriakc"); }
  2002.     elsif ($_[0] == 43) { return("neriakd"); }
  2003.     elsif ($_[0] == 44) { return("najena"); }
  2004.     elsif ($_[0] == 45) { return("qcat"); }
  2005.     elsif ($_[0] == 46) { return("innothule"); }
  2006.     elsif ($_[0] == 47) { return("feerrott"); }
  2007.     elsif ($_[0] == 48) { return("cazicthule"); }
  2008.     elsif ($_[0] == 49) { return("oggok"); }
  2009.     elsif ($_[0] == 50) { return("rathemtn"); }
  2010.     elsif ($_[0] == 51) { return("lakerathe"); }
  2011.     elsif ($_[0] == 52) { return("grobb"); }
  2012.     elsif ($_[0] == 53) { return("aviak"); }
  2013.     elsif ($_[0] == 54) { return("gfaydark"); }
  2014.     elsif ($_[0] == 55) { return("akanon"); }
  2015.     elsif ($_[0] == 56) { return("steamfont"); }
  2016.     elsif ($_[0] == 57) { return("lfaydark"); }
  2017.     elsif ($_[0] == 58) { return("crushbone"); }
  2018.     elsif ($_[0] == 59) { return("mistmoore"); }
  2019.     elsif ($_[0] == 60) { return("kaladima"); }
  2020.     elsif ($_[0] == 61) { return("felwithea"); }
  2021.     elsif ($_[0] == 62) { return("felwitheb"); }
  2022.     elsif ($_[0] == 63) { return("unrest"); }
  2023.     elsif ($_[0] == 64) { return("kedge"); }
  2024.     elsif ($_[0] == 65) { return("guktop"); }
  2025.     elsif ($_[0] == 66) { return("gukbottom"); }
  2026.     elsif ($_[0] == 67) { return("kaladimb"); }
  2027.     elsif ($_[0] == 68) { return("butcher"); }
  2028.     elsif ($_[0] == 69) { return("oot"); }
  2029.     elsif ($_[0] == 70) { return("cauldron"); }
  2030.     elsif ($_[0] == 71) { return("airplane"); }
  2031.     elsif ($_[0] == 72) { return("fearplane"); }
  2032.     elsif ($_[0] == 73) { return("permafrost"); }
  2033.     elsif ($_[0] == 74) { return("kerraridge"); }
  2034.     elsif ($_[0] == 75) { return("paineel"); }
  2035.     elsif ($_[0] == 76) { return("hateplane"); }
  2036.     elsif ($_[0] == 77) { return("arena"); }
  2037.     elsif ($_[0] == 78) { return("fieldofbone"); }
  2038.     elsif ($_[0] == 79) { return("warslikswood"); }
  2039.     elsif ($_[0] == 80) { return("soltemple"); }
  2040.     elsif ($_[0] == 81) { return("droga"); }
  2041.     elsif ($_[0] == 82) { return("cabwest"); }
  2042.     elsif ($_[0] == 83) { return("swampofnohope"); }
  2043.     elsif ($_[0] == 84) { return("firiona"); }
  2044.     elsif ($_[0] == 85) { return("lakeofillomen"); }
  2045.     elsif ($_[0] == 86) { return("dreadlands"); }
  2046.     elsif ($_[0] == 87) { return("burningwood"); }
  2047.     elsif ($_[0] == 88) { return("kaesora"); }
  2048.     elsif ($_[0] == 89) { return("sebilis"); }
  2049.     elsif ($_[0] == 90) { return("citymist"); }
  2050.     elsif ($_[0] == 91) { return("skyfire"); }
  2051.     elsif ($_[0] == 92) { return("frontiermtns"); }
  2052.     elsif ($_[0] == 93) { return("overthere"); }
  2053.     elsif ($_[0] == 94) { return("emeraldjungle"); }
  2054.     elsif ($_[0] == 95) { return("trakanon"); }
  2055.     elsif ($_[0] == 96) { return("timorous"); }
  2056.     elsif ($_[0] == 97) { return("kurn"); }
  2057.     elsif ($_[0] == 98) { return("erudsxing"); }
  2058.     elsif ($_[0] == 100) { return("stonebrunt"); }
  2059.     elsif ($_[0] == 101) { return("warrens"); }
  2060.     elsif ($_[0] == 102) { return("karnor"); }
  2061.     elsif ($_[0] == 103) { return("chardok"); }
  2062.     elsif ($_[0] == 104) { return("dalnir"); }
  2063.     elsif ($_[0] == 105) { return("charasis"); }
  2064.     elsif ($_[0] == 106) { return("cabeast"); }
  2065.     elsif ($_[0] == 107) { return("nurga"); }
  2066.     elsif ($_[0] == 108) { return("veeshan"); }
  2067.     elsif ($_[0] == 109) { return("veksar"); }
  2068.     elsif ($_[0] == 110) { return("iceclad"); }
  2069.     elsif ($_[0] == 111) { return("frozenshadow"); }
  2070.     elsif ($_[0] == 112) { return("velketor"); }
  2071.     elsif ($_[0] == 113) { return("kael"); }
  2072.     elsif ($_[0] == 114) { return("skyshrine"); }
  2073.     elsif ($_[0] == 114) { return("skyshrine"); }
  2074.     elsif ($_[0] == 115) { return("thurgadina"); }
  2075.     elsif ($_[0] == 116) { return("eastwastes"); }
  2076.     elsif ($_[0] == 117) { return("cobaltscar"); }
  2077.     elsif ($_[0] == 118) { return("greatdivide"); }
  2078.     elsif ($_[0] == 119) { return("wakening"); }
  2079.     elsif ($_[0] == 120) { return("westwastes"); }
  2080.     elsif ($_[0] == 121) { return("crystal"); }
  2081.     elsif ($_[0] == 123) { return("necropolis"); }
  2082.     elsif ($_[0] == 124) { return("templeveeshan"); }
  2083.     elsif ($_[0] == 125) { return("sirens"); }
  2084.     elsif ($_[0] == 126) { return("mischiefplane"); }
  2085.     elsif ($_[0] == 127) { return("growthplane"); }
  2086.     elsif ($_[0] == 128) { return("sleeper"); }
  2087.     elsif ($_[0] == 129) { return("thurgadinb"); }
  2088.     elsif ($_[0] == 130) { return("erudsxing2"); }
  2089.     elsif ($_[0] == 150) { return("shadowhaven"); }
  2090.     elsif ($_[0] == 151) { return("bazaar"); }
  2091.     elsif ($_[0] == 151) { return("bazaar"); }
  2092.     elsif ($_[0] == 152) { return("nexus"); }
  2093.     elsif ($_[0] == 153) { return("echo"); }
  2094.     elsif ($_[0] == 154) { return("acrylia"); }
  2095.     elsif ($_[0] == 155) { return("sharvahl"); }
  2096.     elsif ($_[0] == 156) { return("paludal"); }
  2097.     elsif ($_[0] == 157) { return("fungusgrove"); }
  2098.     elsif ($_[0] == 158) { return("vexthal"); }
  2099.     elsif ($_[0] == 159) { return("sseru"); }
  2100.     elsif ($_[0] == 160) { return("katta"); }
  2101.     elsif ($_[0] == 161) { return("netherbian"); }
  2102.     elsif ($_[0] == 162) { return("ssratemple"); }
  2103.     elsif ($_[0] == 163) { return("griegsend"); }
  2104.     elsif ($_[0] == 164) { return("thedeep"); }
  2105.     elsif ($_[0] == 165) { return("shadeweaver"); }
  2106.     elsif ($_[0] == 166) { return("hollowshade"); }
  2107.     elsif ($_[0] == 167) { return("grimling"); }
  2108.     elsif ($_[0] == 168) { return("mseru"); }
  2109.     elsif ($_[0] == 169) { return("letalis"); }
  2110.     elsif ($_[0] == 170) { return("twilight"); }
  2111.     elsif ($_[0] == 171) { return("thegrey"); }
  2112.     elsif ($_[0] == 172) { return("tenebrous"); }
  2113.     elsif ($_[0] == 173) { return("maiden"); }
  2114.     elsif ($_[0] == 174) { return("dawnshroud"); }
  2115.     elsif ($_[0] == 175) { return("scarlet"); }
  2116.     elsif ($_[0] == 176) { return("umbral"); }
  2117.     elsif ($_[0] == 179) { return("akheva"); }
  2118.     elsif ($_[0] == 180) { return("arena2"); }
  2119.     elsif ($_[0] == 181) { return("jaggedpine"); }
  2120.     elsif ($_[0] == 182) { return("nedaria"); }
  2121.     elsif ($_[0] == 183) { return("tutorial"); }
  2122.     elsif ($_[0] == 184) { return("load"); }
  2123.     elsif ($_[0] == 185) { return("load2"); }
  2124.     elsif ($_[0] == 186) { return("hateplaneb"); }
  2125.     elsif ($_[0] == 187) { return("shadowrest"); }
  2126.     elsif ($_[0] == 188) { return("tutoriala"); }
  2127.     elsif ($_[0] == 189) { return("tutorialb"); }
  2128.     elsif ($_[0] == 190) { return("clz"); }
  2129.     elsif ($_[0] == 200) { return("codecay"); }
  2130.     elsif ($_[0] == 201) { return("pojustice"); }
  2131.     elsif ($_[0] == 202) { return("poknowledge"); }
  2132.     elsif ($_[0] == 203) { return("potranquility"); }
  2133.     elsif ($_[0] == 204) { return("ponightmare"); }
  2134.     elsif ($_[0] == 205) { return("podisease"); }
  2135.     elsif ($_[0] == 206) { return("poinnovation"); }
  2136.     elsif ($_[0] == 207) { return("potorment"); }
  2137.     elsif ($_[0] == 208) { return("povalor"); }
  2138.     elsif ($_[0] == 209) { return("bothunder"); }
  2139.     elsif ($_[0] == 210) { return("postorms"); }
  2140.     elsif ($_[0] == 211) { return("hohonora"); }
  2141.     elsif ($_[0] == 212) { return("solrotower"); }
  2142.     elsif ($_[0] == 213) { return("powar"); }
  2143.     elsif ($_[0] == 214) { return("potactics"); }
  2144.     elsif ($_[0] == 215) { return("poair"); }
  2145.     elsif ($_[0] == 216) { return("powater"); }
  2146.     elsif ($_[0] == 217) { return("pofire"); }
  2147.     elsif ($_[0] == 218) { return("poeartha"); }
  2148.     elsif ($_[0] == 219) { return("potimea"); }
  2149.     elsif ($_[0] == 220) { return("hohonorb"); }
  2150.     elsif ($_[0] == 221) { return("nightmareb"); }
  2151.     elsif ($_[0] == 222) { return("poearthb"); }
  2152.     elsif ($_[0] == 223) { return("potimeb"); }
  2153.     elsif ($_[0] == 224) { return("gunthak"); }
  2154.     elsif ($_[0] == 225) { return("dulak"); }
  2155.     elsif ($_[0] == 226) { return("torgiran"); }
  2156.     elsif ($_[0] == 227) { return("nadox"); }
  2157.     elsif ($_[0] == 228) { return("hatesfury"); }
  2158.     elsif ($_[0] == 229) { return("guka"); }
  2159.     elsif ($_[0] == 230) { return("ruja"); }
  2160.     elsif ($_[0] == 231) { return("taka"); }
  2161.     elsif ($_[0] == 232) { return("mira"); }
  2162.     elsif ($_[0] == 233) { return("mmca"); }
  2163.     elsif ($_[0] == 234) { return("gukb"); }
  2164.     elsif ($_[0] == 235) { return("rujb"); }
  2165.     elsif ($_[0] == 236) { return("takb"); }
  2166.     elsif ($_[0] == 237) { return("mirb"); }
  2167.     elsif ($_[0] == 238) { return("mmcb"); }
  2168.     elsif ($_[0] == 239) { return("gukc"); }
  2169.     elsif ($_[0] == 240) { return("rujc"); }
  2170.     elsif ($_[0] == 241) { return("takc"); }
  2171.     elsif ($_[0] == 242) { return("mirc"); }
  2172.     elsif ($_[0] == 243) { return("mmcc"); }
  2173.     elsif ($_[0] == 244) { return("gukd"); }
  2174.     elsif ($_[0] == 245) { return("rujd"); }
  2175.     elsif ($_[0] == 246) { return("takd"); }
  2176.     elsif ($_[0] == 247) { return("mird"); }
  2177.     elsif ($_[0] == 248) { return("mmcd"); }
  2178.     elsif ($_[0] == 249) { return("guke"); }
  2179.     elsif ($_[0] == 250) { return("ruje"); }
  2180.     elsif ($_[0] == 251) { return("take"); }
  2181.     elsif ($_[0] == 252) { return("mire"); }
  2182.     elsif ($_[0] == 253) { return("mmce"); }
  2183.     elsif ($_[0] == 254) { return("gukf"); }
  2184.     elsif ($_[0] == 255) { return("rujf"); }
  2185.     elsif ($_[0] == 256) { return("takf"); }
  2186.     elsif ($_[0] == 257) { return("mirf"); }
  2187.     elsif ($_[0] == 258) { return("mmcf"); }
  2188.     elsif ($_[0] == 259) { return("gukg"); }
  2189.     elsif ($_[0] == 260) { return("rujg"); }
  2190.     elsif ($_[0] == 261) { return("takg"); }
  2191.     elsif ($_[0] == 262) { return("mirg"); }
  2192.     elsif ($_[0] == 263) { return("mmcg"); }
  2193.     elsif ($_[0] == 264) { return("gukh"); }
  2194.     elsif ($_[0] == 265) { return("rujh"); }
  2195.     elsif ($_[0] == 266) { return("takh"); }
  2196.     elsif ($_[0] == 267) { return("mirh"); }
  2197.     elsif ($_[0] == 268) { return("mmch"); }
  2198.     elsif ($_[0] == 269) { return("ruji"); }
  2199.     elsif ($_[0] == 270) { return("taki"); }
  2200.     elsif ($_[0] == 271) { return("miri"); }
  2201.     elsif ($_[0] == 272) { return("mmci"); }
  2202.     elsif ($_[0] == 273) { return("rujj"); }
  2203.     elsif ($_[0] == 274) { return("takj"); }
  2204.     elsif ($_[0] == 275) { return("mirj"); }
  2205.     elsif ($_[0] == 276) { return("mmcj"); }
  2206.     elsif ($_[0] == 277) { return("chardokb"); }
  2207.     elsif ($_[0] == 278) { return("soldungc"); }
  2208.     elsif ($_[0] == 279) { return("abysmal"); }
  2209.     elsif ($_[0] == 280) { return("natimbi"); }
  2210.     elsif ($_[0] == 281) { return("qinimi"); }
  2211.     elsif ($_[0] == 282) { return("riwwi"); }
  2212.     elsif ($_[0] == 283) { return("barindu"); }
  2213.     elsif ($_[0] == 284) { return("ferubi"); }
  2214.     elsif ($_[0] == 285) { return("snpool"); }
  2215.     elsif ($_[0] == 286) { return("snlair"); }
  2216.     elsif ($_[0] == 287) { return("snplant"); }
  2217.     elsif ($_[0] == 288) { return("sncrematory"); }
  2218.     elsif ($_[0] == 289) { return("tipt"); }
  2219.     elsif ($_[0] == 290) { return("vxed"); }
  2220.     elsif ($_[0] == 291) { return("yxtta"); }
  2221.     elsif ($_[0] == 292) { return("uqua"); }
  2222.     elsif ($_[0] == 293) { return("kodtaz"); }
  2223.     elsif ($_[0] == 294) { return("ikkinz"); }
  2224.     elsif ($_[0] == 295) { return("qvic"); }
  2225.     elsif ($_[0] == 296) { return("inktuta"); }
  2226.     elsif ($_[0] == 297) { return("txevu"); }
  2227.     elsif ($_[0] == 298) { return("tacvi"); }
  2228.     elsif ($_[0] == 299) { return("qvicb"); }
  2229.     elsif ($_[0] == 300) { return("wallofslaughter"); }
  2230.     elsif ($_[0] == 301) { return("bloodfields"); }
  2231.     elsif ($_[0] == 302) { return("draniksscar"); }
  2232.     elsif ($_[0] == 303) { return("causeway"); }
  2233.     elsif ($_[0] == 304) { return("chambersa"); }
  2234.     elsif ($_[0] == 305) { return("chambersb"); }
  2235.     elsif ($_[0] == 306) { return("chambersc"); }
  2236.     elsif ($_[0] == 307) { return("chambersd"); }
  2237.     elsif ($_[0] == 308) { return("chamberse"); }
  2238.     elsif ($_[0] == 309) { return("chambersf"); }
  2239.     elsif ($_[0] == 316) { return("provinggrounds"); }
  2240.     elsif ($_[0] == 317) { return("anguish"); }
  2241.     elsif ($_[0] == 318) { return("dranikhollowsa"); }
  2242.     elsif ($_[0] == 319) { return("dranikhollowsb"); }
  2243.     elsif ($_[0] == 320) { return("dranikhollowsc"); }
  2244.     elsif ($_[0] == 328) { return("dranikcatacombsa"); }
  2245.     elsif ($_[0] == 329) { return("dranikcatacombsb"); }
  2246.     elsif ($_[0] == 330) { return("dranikcatacombsc"); }
  2247.     elsif ($_[0] == 331) { return("draniksewersa"); }
  2248.     elsif ($_[0] == 332) { return("draniksewersb"); }
  2249.     elsif ($_[0] == 333) { return("draniksewersc"); }
  2250.     elsif ($_[0] == 334) { return("riftseekers"); }
  2251.     elsif ($_[0] == 335) { return("harbingers"); }
  2252.     elsif ($_[0] == 336) { return("dranik"); }
  2253.     elsif ($_[0] == 337) { return("broodlands"); }
  2254.     elsif ($_[0] == 338) { return("stillmoona"); }
  2255.     elsif ($_[0] == 339) { return("stillmoonb"); }
  2256.     elsif ($_[0] == 340) { return("thundercrest"); }
  2257.     elsif ($_[0] == 341) { return("delvea"); }
  2258.     elsif ($_[0] == 342) { return("delveb"); }
  2259.     elsif ($_[0] == 343) { return("thenest"); }
  2260.     elsif ($_[0] == 344) { return("guildlobby"); }
  2261.     elsif ($_[0] == 345) { return("guildhall"); }
  2262.     elsif ($_[0] == 346) { return("barter"); }
  2263.     elsif ($_[0] == 347) { return("illsalin"); }
  2264.     elsif ($_[0] == 348) { return("illsalina"); }
  2265.     elsif ($_[0] == 349) { return("illsalinb"); }
  2266.     elsif ($_[0] == 350) { return("illsalinc"); }
  2267.     elsif ($_[0] == 351) { return("dreadspire"); }
  2268.     elsif ($_[0] == 354) { return("drachnidhive"); }
  2269.     elsif ($_[0] == 355) { return("drachnidhivea"); }
  2270.     elsif ($_[0] == 356) { return("drachnidhiveb"); }
  2271.     elsif ($_[0] == 357) { return("drachnidhivec"); }
  2272.     elsif ($_[0] == 358) { return("westkorlach"); }
  2273.     elsif ($_[0] == 359) { return("westkorlacha"); }
  2274.     elsif ($_[0] == 360) { return("westkorlachb"); }
  2275.     elsif ($_[0] == 361) { return("westkorlachc"); }
  2276.     elsif ($_[0] == 362) { return("eastkorlach"); }
  2277.     elsif ($_[0] == 363) { return("eastkorlacha"); }
  2278.     elsif ($_[0] == 364) { return("shadowspine"); }
  2279.     elsif ($_[0] == 365) { return("corathus"); }
  2280.     elsif ($_[0] == 366) { return("corathusa"); }
  2281.     elsif ($_[0] == 367) { return("corathusb"); }
  2282.     elsif ($_[0] == 368) { return("nektulosa"); }
  2283.     elsif ($_[0] == 369) { return("arcstone"); }
  2284.     elsif ($_[0] == 370) { return("relic"); }
  2285.     elsif ($_[0] == 371) { return("skylance"); }
  2286.     elsif ($_[0] == 372) { return("devastation"); }
  2287.     elsif ($_[0] == 373) { return("devastationa"); }
  2288.     elsif ($_[0] == 374) { return("rage"); }
  2289.     elsif ($_[0] == 375) { return("ragea"); }
  2290.     elsif ($_[0] == 376) { return("takishruins"); }
  2291.     elsif ($_[0] == 377) { return("takishruinsa"); }
  2292.     elsif ($_[0] == 378) { return("elddar"); }
  2293.     elsif ($_[0] == 379) { return("elddara"); }
  2294.     elsif ($_[0] == 380) { return("theater"); }
  2295.     elsif ($_[0] == 381) { return("theatera"); }
  2296.     elsif ($_[0] == 382) { return("freeporteast"); }
  2297.     elsif ($_[0] == 383) { return("freeportwest"); }
  2298.     elsif ($_[0] == 384) { return("freeportsewers"); }
  2299.     elsif ($_[0] == 385) { return("freeportacademy"); }
  2300.     elsif ($_[0] == 386) { return("freeporttemple"); }
  2301.     elsif ($_[0] == 387) { return("freeportmilitia"); }
  2302.     elsif ($_[0] == 388) { return("freeportarena"); }
  2303.     elsif ($_[0] == 389) { return("freeportcityhall"); }
  2304.     elsif ($_[0] == 390) { return("freeporttheater"); }
  2305.     elsif ($_[0] == 391) { return("freeporthall"); }
  2306.     elsif ($_[0] == 392) { return("northro"); }
  2307.     elsif ($_[0] == 393) { return("southro"); }
  2308.     elsif ($_[0] == 394) { return("crescent"); }
  2309.     elsif ($_[0] == 395) { return("moors"); }
  2310.     elsif ($_[0] == 396) { return("stonehive"); }
  2311.     elsif ($_[0] == 397) { return("mesa"); }
  2312.     elsif ($_[0] == 398) { return("roost"); }
  2313.     elsif ($_[0] == 399) { return("steppes"); }
  2314.     elsif ($_[0] == 400) { return("icefall"); }
  2315.     elsif ($_[0] == 401) { return("valdeholm"); }
  2316.     elsif ($_[0] == 402) { return("frostcrypt"); }
  2317.     elsif ($_[0] == 403) { return("sunderock"); }
  2318.     elsif ($_[0] == 404) { return("vergalid"); }
  2319.     elsif ($_[0] == 405) { return("direwind"); }
  2320.     elsif ($_[0] == 406) { return("ashengate"); }
  2321.     elsif ($_[0] == 407) { return("highpasshold"); }
  2322.     elsif ($_[0] == 408) { return("commonlands"); }
  2323.     elsif ($_[0] == 409) { return("oceanoftears"); }
  2324.     elsif ($_[0] == 410) { return("kithforest"); }
  2325.     elsif ($_[0] == 411) { return("befallenb"); }
  2326.     elsif ($_[0] == 412) { return("highpasskeep"); }
  2327.     elsif ($_[0] == 413) { return("innothuleb"); }
  2328.     elsif ($_[0] == 414) { return("toxxulia"); }
  2329.     elsif ($_[0] == 415) { return("mistythicket"); }
  2330.     elsif ($_[0] == 416) { return("kattacastrum"); }
  2331.     elsif ($_[0] == 417) { return("thalassius"); }
  2332.     elsif ($_[0] == 418) { return("atiiki"); }
  2333.     elsif ($_[0] == 419) { return("zhisza"); }
  2334.     elsif ($_[0] == 420) { return("silyssar"); }
  2335.     elsif ($_[0] == 421) { return("solteris"); }
  2336.     elsif ($_[0] == 422) { return("barren"); }
  2337.     elsif ($_[0] == 423) { return("buriedsea"); }
  2338.     elsif ($_[0] == 424) { return("jardelshook"); }
  2339.     elsif ($_[0] == 425) { return("monkeyrock"); }
  2340.     elsif ($_[0] == 426) { return("suncrest"); }
  2341.     elsif ($_[0] == 427) { return("deadbone"); }
  2342.     elsif ($_[0] == 428) { return("blacksail"); }
  2343.     elsif ($_[0] == 429) { return("maidensgrave"); }
  2344.     elsif ($_[0] == 430) { return("redfeather"); }
  2345.     elsif ($_[0] == 431) { return("shipmvp"); }
  2346.     elsif ($_[0] == 432) { return("shipmvu"); }
  2347.     elsif ($_[0] == 433) { return("shippvu"); }
  2348.     elsif ($_[0] == 434) { return("shipuvu"); }
  2349.     elsif ($_[0] == 435) { return("shipmvm"); }
  2350.     elsif ($_[0] == 436) { return("mechanotus"); }
  2351.     elsif ($_[0] == 437) { return("mansion"); }
  2352.     elsif ($_[0] == 438) { return("steamfactory"); }
  2353.     elsif ($_[0] == 439) { return("shipworkshop"); }
  2354.     elsif ($_[0] == 440) { return("gyrospireb"); }
  2355.     elsif ($_[0] == 441) { return("gyrospirez"); }
  2356.     elsif ($_[0] == 442) { return("dragonscale"); }
  2357.     elsif ($_[0] == 443) { return("lopingplains"); }
  2358.     elsif ($_[0] == 444) { return("hillsofshade"); }
  2359.     elsif ($_[0] == 445) { return("bloodmoon"); }
  2360.     elsif ($_[0] == 446) { return("crystallos"); }
  2361.     elsif ($_[0] == 447) { return("guardian"); }
  2362.     elsif ($_[0] == 448) { return("steamfontmts"); }
  2363.     elsif ($_[0] == 449) { return("cryptofshade"); }
  2364.     elsif ($_[0] == 451) { return("dragonscaleb"); }
  2365.     elsif ($_[0] == 452) { return("oldfieldofbone"); }
  2366.     elsif ($_[0] == 453) { return("oldkaesoraa"); }
  2367.     elsif ($_[0] == 454) { return("oldkaesorab"); }
  2368.     elsif ($_[0] == 455) { return("oldkurn"); }
  2369.     elsif ($_[0] == 456) { return("oldkithicor"); }
  2370.     elsif ($_[0] == 457) { return("oldcommons"); }
  2371.     elsif ($_[0] == 458) { return("oldhighpass"); }
  2372.     elsif ($_[0] == 459) { return("thevoida"); }
  2373.     elsif ($_[0] == 460) { return("thevoidb"); }
  2374.     elsif ($_[0] == 461) { return("thevoidc"); }
  2375.     elsif ($_[0] == 462) { return("thevoidd"); }
  2376.     elsif ($_[0] == 463) { return("thevoide"); }
  2377.     elsif ($_[0] == 464) { return("thevoidf"); }
  2378.     elsif ($_[0] == 465) { return("thevoidg"); }
  2379.     elsif ($_[0] == 466) { return("oceangreenhills"); }
  2380.     elsif ($_[0] == 467) { return("oceangreenvillage"); }
  2381.     elsif ($_[0] == 468) { return("oldblackburrow"); }
  2382.     elsif ($_[0] == 469) { return("bertoxtemple"); }
  2383.     elsif ($_[0] == 470) { return("discord"); }
  2384.     elsif ($_[0] == 471) { return("discordtower"); }
  2385.     elsif ($_[0] == 472) { return("oldbloodfield"); }
  2386.     elsif ($_[0] == 473) { return("precipiceofwar"); }
  2387.     elsif ($_[0] == 474) { return("olddranik"); }
  2388.     elsif ($_[0] == 475) { return("toskirakk"); }
  2389.     elsif ($_[0] == 476) { return("korascian"); }
  2390.     elsif ($_[0] == 477) { return("rathechamber"); }
  2391.     elsif ($_[0] == 480) { return("brellsrest"); }
  2392.     elsif ($_[0] == 481) { return("fungalforest"); }
  2393.     elsif ($_[0] == 482) { return("underquarry"); }
  2394.     elsif ($_[0] == 483) { return("coolingchamber"); }
  2395.     elsif ($_[0] == 484) { return("shiningcity"); }
  2396.     elsif ($_[0] == 485) { return("arthicrex"); }
  2397.     elsif ($_[0] == 486) { return("foundation"); }
  2398.     elsif ($_[0] == 487) { return("lichencreep"); }
  2399.     elsif ($_[0] == 488) { return("pellucid"); }
  2400.     elsif ($_[0] == 489) { return("stonesnake"); }
  2401.     elsif ($_[0] == 490) { return("brellstemple"); }
  2402.     elsif ($_[0] == 491) { return("convorteum"); }
  2403.     elsif ($_[0] == 492) { return("brellsarena"); }
  2404.     elsif ($_[0] == 493) { return("weddingchapel"); }
  2405.     elsif ($_[0] == 494) { return("weddingchapeldark"); }
  2406.     elsif ($_[0] == 495) { return("dragoncrypt"); }
  2407.     elsif ($_[0] == 700) { return("feerrott2"); }
  2408.     elsif ($_[0] == 701) { return("thulehouse1"); }
  2409.     elsif ($_[0] == 702) { return("thulehouse2"); }
  2410.     elsif ($_[0] == 703) { return("housegarden"); }
  2411.     elsif ($_[0] == 704) { return("thulelibrary"); }
  2412.     elsif ($_[0] == 705) { return("well"); }
  2413.     elsif ($_[0] == 706) { return("fallen"); }
  2414.     elsif ($_[0] == 707) { return("morellcastle"); }
  2415.     elsif ($_[0] == 708) { return("somnium"); }
  2416.     elsif ($_[0] == 709) { return("alkabormare"); }
  2417.     elsif ($_[0] == 710) { return("miragulmare"); }
  2418.     elsif ($_[0] == 711) { return("thuledream"); }
  2419.     elsif ($_[0] == 712) { return("neighborhood"); }
  2420.     elsif ($_[0] == 724) { return("argath"); }
  2421.     elsif ($_[0] == 725) { return("arelis"); }
  2422.     elsif ($_[0] == 726) { return("sarithcity"); }
  2423.     elsif ($_[0] == 727) { return("rubak"); }
  2424.     elsif ($_[0] == 728) { return("beastdomain"); }
  2425.     elsif ($_[0] == 729) { return("resplendent"); }
  2426.     elsif ($_[0] == 730) { return("pillarsalra"); }
  2427.     elsif ($_[0] == 731) { return("windsong"); }
  2428.     elsif ($_[0] == 732) { return("cityofbronze"); }
  2429.     elsif ($_[0] == 733) { return("sepulcher"); }
  2430.     elsif ($_[0] == 734) { return("eastsepulcher"); }
  2431.     elsif ($_[0] == 735) { return("westsepulcher"); }
  2432.     elsif ($_[0] == 996) { return("arttest"); }
  2433.     elsif ($_[0] == 998) { return("fhalls"); }
  2434.     elsif ($_[0] == 999) { return("apprentice"); }
  2435.     else { return("ELSE ERROR ZONE ID TO NAME"); }
  2436. } # End GET_ZONE_NAME_BY_ID()
  2437.  
  2438.  
  2439. ### Copy from Akkadius Plugin
  2440. sub ListZoneSNToID2
  2441. {
  2442.     my $ZoneSN = $_[0];
  2443.     my $text = plugin::val('$text');
  2444.     %ZoneList = (
  2445.         "qeynos" => 1,
  2446.         "qeynos2" => 2,
  2447.         "qrg" => 3,
  2448.         "qeytoqrg" => 4,
  2449.         "highpass" => 5,
  2450.         "highkeep" => 6,
  2451.         "freportn" => 8,
  2452.         "freportw" => 9,
  2453.         "freporte" => 10,
  2454.         "runnyeye" => 11,
  2455.         "qey2hh1" => 12,
  2456.         "northkarana" => 13,
  2457.         "southkarana" => 14,
  2458.         "eastkarana" => 15,
  2459.         "beholder" => 16,
  2460.         "blackburrow" => 17,
  2461.         "paw" => 18,
  2462.         "rivervale" => 19,
  2463.         "kithicor" => 20,
  2464.         "commons" => 21,
  2465.         "ecommons" => 22,
  2466.         "erudnint" => 23,
  2467.         "erudnext" => 24,
  2468.         "nektulos" => 25,
  2469.         "cshome" => 26,
  2470.         "lavastorm" => 27,
  2471.         "nektropos" => 28,
  2472.         "halas" => 29,
  2473.         "everfrost" => 30,
  2474.         "soldunga" => 31,
  2475.         "soldungb" => 32,
  2476.         "misty" => 33,
  2477.         "nro" => 34,
  2478.         "sro" => 35,
  2479.         "befallen" => 36,
  2480.         "oasis" => 37,
  2481.         "tox" => 38,
  2482.         "hole" => 39,
  2483.         "neriaka" => 40,
  2484.         "neriakb" => 41,
  2485.         "neriakc" => 42,
  2486.         "neriakd" => 43,
  2487.         "najena" => 44,
  2488.         "qcat" => 45,
  2489.         "innothule" => 46,
  2490.         "feerrott" => 47,
  2491.         "cazicthule" => 48,
  2492.         "oggok" => 49,
  2493.         "rathemtn" => 50,
  2494.         "lakerathe" => 51,
  2495.         "grobb" => 52,
  2496.         "aviak" => 53,
  2497.         "gfaydark" => 54,
  2498.         "akanon" => 55,
  2499.         "steamfont" => 56,
  2500.         "lfaydark" => 57,
  2501.         "crushbone" => 58,
  2502.         "mistmoore" => 59,
  2503.         "kaladima" => 60,
  2504.         "felwithea" => 61,
  2505.         "felwitheb" => 62,
  2506.         "unrest" => 63,
  2507.         "kedge" => 64,
  2508.         "guktop" => 65,
  2509.         "gukbottom" => 66,
  2510.         "kaladimb" => 67,
  2511.         "butcher" => 68,
  2512.         "oot" => 69,
  2513.         "cauldron" => 70,
  2514.         "airplane" => 71,
  2515.         "fearplane" => 72,
  2516.         "permafrost" => 73,
  2517.         "kerraridge" => 74,
  2518.         "paineel" => 75,
  2519.         "hateplane" => 76,
  2520.         "arena" => 77,
  2521.         "fieldofbone" => 78,
  2522.         "warslikswood" => 79,
  2523.         "soltemple" => 80,
  2524.         "droga" => 81,
  2525.         "cabwest" => 82,
  2526.         "swampofnohope" => 83,
  2527.         "firiona" => 84,
  2528.         "lakeofillomen" => 85,
  2529.         "dreadlands" => 86,
  2530.         "burningwood" => 87,
  2531.         "kaesora" => 88,
  2532.         "sebilis" => 89,
  2533.         "citymist" => 90,
  2534.         "skyfire" => 91,
  2535.         "frontiermtns" => 92,
  2536.         "overthere" => 93,
  2537.         "emeraldjungle" => 94,
  2538.         "trakanon" => 95,
  2539.         "timorous" => 96,
  2540.         "kurn" => 97,
  2541.         "erudsxing" => 98,
  2542.         "stonebrunt" => 100,
  2543.         "warrens" => 101,
  2544.         "karnor" => 102,
  2545.         "chardok" => 103,
  2546.         "dalnir" => 104,
  2547.         "charasis" => 105,
  2548.         "cabeast" => 106,
  2549.         "nurga" => 107,
  2550.         "veeshan" => 108,
  2551.         "veksar" => 109,
  2552.         "iceclad" => 110,
  2553.         "frozenshadow" => 111,
  2554.         "velketor" => 112,
  2555.         "kael" => 113,
  2556.         "skyshrine" => 114,
  2557.         "thurgadina" => 115,
  2558.         "eastwastes" => 116,
  2559.         "cobaltscar" => 117,
  2560.         "greatdivide" => 118,
  2561.         "wakening" => 119,
  2562.         "westwastes" => 120,
  2563.         "crystal" => 121,
  2564.         "necropolis" => 123,
  2565.         "templeveeshan" => 124,
  2566.         "sirens" => 125,
  2567.         "mischiefplane" => 126,
  2568.         "growthplane" => 127,
  2569.         "sleeper" => 128,
  2570.         "thurgadinb" => 129,
  2571.         "erudsxing2" => 130,
  2572.         "shadowhaven" => 150,
  2573.         "bazaar" => 151,
  2574.         "nexus" => 152,
  2575.         "echo" => 153,
  2576.         "acrylia" => 154,
  2577.         "sharvahl" => 155,
  2578.         "paludal" => 156,
  2579.         "fungusgrove" => 157,
  2580.         "vexthal" => 158,
  2581.         "sseru" => 159,
  2582.         "katta" => 160,
  2583.         "netherbian" => 161,
  2584.         "ssratemple" => 162,
  2585.         "griegsend" => 163,
  2586.         "thedeep" => 164,
  2587.         "shadeweaver" => 165,
  2588.         "hollowshade" => 166,
  2589.         "grimling" => 167,
  2590.         "mseru" => 168,
  2591.         "letalis" => 169,
  2592.         "twilight" => 170,
  2593.         "thegrey" => 171,
  2594.         "tenebrous" => 172,
  2595.         "maiden" => 173,
  2596.         "dawnshroud" => 174,
  2597.         "scarlet" => 175,
  2598.         "umbral" => 176,
  2599.         "akheva" => 179,
  2600.         "arena2" => 180,
  2601.         "jaggedpine" => 181,
  2602.         "nedaria" => 182,
  2603.         "tutorial" => 183,
  2604.         "load" => 184,
  2605.         "load2" => 185,
  2606.         "hateplaneb" => 186,
  2607.         "shadowrest" => 187,
  2608.         "tutoriala" => 188,
  2609.         "tutorialb" => 189,
  2610.         "clz" => 190,
  2611.         "codecay" => 200,
  2612.         "pojustice" => 201,
  2613.         "poknowledge" => 202,
  2614.         "potranquility" => 203,
  2615.         "ponightmare" => 204,
  2616.         "podisease" => 205,
  2617.         "poinnovation" => 206,
  2618.         "potorment" => 207,
  2619.         "povalor" => 208,
  2620.         "bothunder" => 209,
  2621.         "postorms" => 210,
  2622.         "hohonora" => 211,
  2623.         "solrotower" => 212,
  2624.         "powar" => 213,
  2625.         "potactics" => 214,
  2626.         "poair" => 215,
  2627.         "powater" => 216,
  2628.         "pofire" => 217,
  2629.         "poeartha" => 218,
  2630.         "potimea" => 219,
  2631.         "hohonorb" => 220,
  2632.         "nightmareb" => 221,
  2633.         "poearthb" => 222,
  2634.         "potimeb" => 223,
  2635.         "gunthak" => 224,
  2636.         "dulak" => 225,
  2637.         "torgiran" => 226,
  2638.         "nadox" => 227,
  2639.         "hatesfury" => 228,
  2640.         "guka" => 229,
  2641.         "ruja" => 230,
  2642.         "taka" => 231,
  2643.         "mira" => 232,
  2644.         "mmca" => 233,
  2645.         "gukb" => 234,
  2646.         "rujb" => 235,
  2647.         "takb" => 236,
  2648.         "mirb" => 237,
  2649.         "mmcb" => 238,
  2650.         "gukc" => 239,
  2651.         "rujc" => 240,
  2652.         "takc" => 241,
  2653.         "mirc" => 242,
  2654.         "mmcc" => 243,
  2655.         "gukd" => 244,
  2656.         "rujd" => 245,
  2657.         "takd" => 246,
  2658.         "mird" => 247,
  2659.         "mmcd" => 248,
  2660.         "guke" => 249,
  2661.         "ruje" => 250,
  2662.         "take" => 251,
  2663.         "mire" => 252,
  2664.         "mmce" => 253,
  2665.         "gukf" => 254,
  2666.         "rujf" => 255,
  2667.         "takf" => 256,
  2668.         "mirf" => 257,
  2669.         "mmcf" => 258,
  2670.         "gukg" => 259,
  2671.         "rujg" => 260,
  2672.         "takg" => 261,
  2673.         "mirg" => 262,
  2674.         "mmcg" => 263,
  2675.         "gukh" => 264,
  2676.         "rujh" => 265,
  2677.         "takh" => 266,
  2678.         "mirh" => 267,
  2679.         "mmch" => 268,
  2680.         "ruji" => 269,
  2681.         "taki" => 270,
  2682.         "miri" => 271,
  2683.         "mmci" => 272,
  2684.         "rujj" => 273,
  2685.         "takj" => 274,
  2686.         "mirj" => 275,
  2687.         "mmcj" => 276,
  2688.         "chardokb" => 277,
  2689.         "soldungc" => 278,
  2690.         "abysmal" => 279,
  2691.         "natimbi" => 280,
  2692.         "qinimi" => 281,
  2693.         "riwwi" => 282,
  2694.         "barindu" => 283,
  2695.         "ferubi" => 284,
  2696.         "snpool" => 285,
  2697.         "snlair" => 286,
  2698.         "snplant" => 287,
  2699.         "sncrematory" => 288,
  2700.         "tipt" => 289,
  2701.         "vxed" => 290,
  2702.         "yxtta" => 291,
  2703.         "uqua" => 292,
  2704.         "kodtaz" => 293,
  2705.         "ikkinz" => 294,
  2706.         "qvic" => 295,
  2707.         "inktuta" => 296,
  2708.         "txevu" => 297,
  2709.         "tacvi" => 298,
  2710.         "qvicb" => 299,
  2711.         "wallofslaughter" => 300,
  2712.         "bloodfields" => 301,
  2713.         "draniksscar" => 302,
  2714.         "causeway" => 303,
  2715.         "chambersa" => 304,
  2716.         "chambersb" => 305,
  2717.         "chambersc" => 306,
  2718.         "chambersd" => 307,
  2719.         "chamberse" => 308,
  2720.         "chambersf" => 309,
  2721.         "provinggrounds" => 316,
  2722.         "anguish" => 317,
  2723.         "dranikhollowsa" => 318,
  2724.         "dranikhollowsb" => 319,
  2725.         "dranikhollowsc" => 320,
  2726.         "dranikhollowsd" => 321,
  2727.         "dranikhollowse" => 322,
  2728.         "dranikhollowsf" => 323,
  2729.         "dranikhollowsg" => 324,
  2730.         "dranikhollowsh" => 325,
  2731.         "dranikhollowsi" => 326,
  2732.         "dranikhollowsj" => 327,
  2733.         "dranikcatacombsa" => 328,
  2734.         "dranikcatacombsb" => 329,
  2735.         "dranikcatacombsc" => 330,
  2736.         "draniksewersa" => 331,
  2737.         "draniksewersb" => 332,
  2738.         "draniksewersc" => 333,
  2739.         "riftseekers" => 334,
  2740.         "harbingers" => 335,
  2741.         "dranik" => 336,
  2742.         "broodlands" => 337,
  2743.         "stillmoona" => 338,
  2744.         "stillmoonb" => 339,
  2745.         "thundercrest" => 340,
  2746.         "delvea" => 341,
  2747.         "delveb" => 342,
  2748.         "thenest" => 343,
  2749.         "guildlobby" => 344,
  2750.         "guildhall" => 345,
  2751.         "barter" => 346,
  2752.         "illsalin" => 347,
  2753.         "illsalina" => 348,
  2754.         "illsalinb" => 349,
  2755.         "illsalinc" => 350,
  2756.         "dreadspire" => 351,
  2757.         "drachnidhive" => 354,
  2758.         "drachnidhivea" => 355,
  2759.         "drachnidhiveb" => 356,
  2760.         "drachnidhivec" => 357,
  2761.         "westkorlach" => 358,
  2762.         "westkorlacha" => 359,
  2763.         "westkorlachb" => 360,
  2764.         "westkorlachc" => 361,
  2765.         "eastkorlach" => 362,
  2766.         "eastkorlacha" => 363,
  2767.         "shadowspine" => 364,
  2768.         "corathus" => 365,
  2769.         "corathusa" => 366,
  2770.         "corathusb" => 367,
  2771.         "nektulosa" => 368,
  2772.         "arcstone" => 369,
  2773.         "relic" => 370,
  2774.         "skylance" => 371,
  2775.         "devastation" => 372,
  2776.         "devastationa" => 373,
  2777.         "rage" => 374,
  2778.         "ragea" => 375,
  2779.         "takishruins" => 376,
  2780.         "takishruinsa" => 377,
  2781.         "elddar" => 378,
  2782.         "elddara" => 379,
  2783.         "theater" => 380,
  2784.         "theatera" => 381,
  2785.         "freeporteast" => 382,
  2786.         "freeportwest" => 383,
  2787.         "freeportsewers" => 384,
  2788.         "freeportacademy" => 385,
  2789.         "freeporttemple" => 386,
  2790.         "freeportmilitia" => 387,
  2791.         "freeportarena" => 388,
  2792.         "freeportcityhall" => 389,
  2793.         "freeporttheater" => 390,
  2794.         "freeporthall" => 391,
  2795.         "northro" => 392,
  2796.         "southro" => 393,
  2797.         "crescent" => 394,
  2798.         "moors" => 395,
  2799.         "stonehive" => 396,
  2800.         "mesa" => 397,
  2801.         "roost" => 398,
  2802.         "steppes" => 399,
  2803.         "icefall" => 400,
  2804.         "valdeholm" => 401,
  2805.         "frostcrypt" => 402,
  2806.         "sunderock" => 403,
  2807.         "vergalid" => 404,
  2808.         "direwind" => 405,
  2809.         "ashengate" => 406,
  2810.         "highpasshold" => 407,
  2811.         "commonlands" => 408,
  2812.         "oceanoftears" => 409,
  2813.         "kithforest" => 410,
  2814.         "befallenb" => 411,
  2815.         "highpasskeep" => 412,
  2816.         "innothuleb" => 413,
  2817.         "toxxulia" => 414,
  2818.         "mistythicket" => 415,
  2819.         "kattacastrum" => 416,
  2820.         "thalassius" => 417,
  2821.         "atiiki" => 418,
  2822.         "zhisza" => 419,
  2823.         "silyssar" => 420,
  2824.         "solteris" => 421,
  2825.         "barren" => 422,
  2826.         "buriedsea" => 423,
  2827.         "jardelshook" => 424,
  2828.         "monkeyrock" => 425,
  2829.         "suncrest" => 426,
  2830.         "deadbone" => 427,
  2831.         "blacksail" => 428,
  2832.         "maidensgrave" => 429,
  2833.         "redfeather" => 430,
  2834.         "shipmvp" => 431,
  2835.         "shipmvu" => 432,
  2836.         "shippvu" => 433,
  2837.         "shipuvu" => 434,
  2838.         "shipmvm" => 435,
  2839.         "mechanotus" => 436,
  2840.         "mansion" => 437,
  2841.         "steamfactory" => 438,
  2842.         "shipworkshop" => 439,
  2843.         "gyrospireb" => 440,
  2844.         "gyrospirez" => 441,
  2845.         "dragonscale" => 442,
  2846.         "lopingplains" => 443,
  2847.         "hillsofshade" => 444,
  2848.         "bloodmoon" => 445,
  2849.         "crystallos" => 446,
  2850.         "guardian" => 447,
  2851.         "steamfontmts" => 448,
  2852.         "cryptofshade" => 449,
  2853.         "dragonscaleb" => 451,
  2854.         "oldfieldofbone" => 452,
  2855.         "oldkaesoraa" => 453,
  2856.         "oldkaesorab" => 454,
  2857.         "oldkurn" => 455,
  2858.         "oldkithicor" => 456,
  2859.         "oldcommons" => 457,
  2860.         "oldhighpass" => 458,
  2861.         "thevoida" => 459,
  2862.         "thevoidb" => 460,
  2863.         "thevoidc" => 461,
  2864.         "thevoidd" => 462,
  2865.         "thevoide" => 463,
  2866.         "thevoidf" => 464,
  2867.         "thevoidg" => 465,
  2868.         "oceangreenhills" => 466,
  2869.         "oceangreenvillag" => 467,
  2870.         "oldblackburrow" => 468,
  2871.         "bertoxtemple" => 469,
  2872.         "discord" => 470,
  2873.         "discordtower" => 471,
  2874.         "oldbloodfield" => 472,
  2875.         "precipiceofwar" => 473,
  2876.         "olddranik" => 474,
  2877.         "toskirakk" => 475,
  2878.         "korascian" => 476,
  2879.         "rathechamber" => 477,
  2880.         "arttest" => 996,
  2881.         "fhalls" => 998,
  2882.         "apprentice" => 999,
  2883.         );
  2884.     $ZoneList{$ZoneSN};
  2885. } # End ListZoneSNToID2
  2886.  
  2887.  
  2888. ### Establish a Connection with password from Config File
  2889. sub LoadMySQLConnection
  2890. {
  2891.     use DBI;
  2892.     use DBD::mysql;
  2893.     # GET DB, USER, AND PASS FROM CONFIG FILE
  2894.     my $confile = "eqemu_config.xml"; #default config file
  2895.     open(F, "<$confile") or die "Unable to open config: $confile\n";
  2896.     my $indb = 0;
  2897.  
  2898.     while(<F>)
  2899.     {
  2900.         s/\r//g;
  2901.         if(/<database>/i)                       { $indb = 1; }
  2902.         next unless($indb == 1);
  2903.         if(/<\/database>/i)                     { $indb = 0; last; }
  2904.         if(/<host>(.*)<\/host>/i)               { $host = $1; }
  2905.         elsif(/<username>(.*)<\/username>/i)    { $user = $1; }
  2906.         elsif(/<password>(.*)<\/password>/i)    { $pass = $1; }
  2907.         elsif(/<db>(.*)<\/db>/i)                { $db   = $1; }
  2908.     }
  2909.  
  2910.     # DATA SOURCE NAME
  2911.     my $dsn = "dbi:mysql:$db:localhost:3306";
  2912.     # PERL DBI CONNECT
  2913.     my $connect = DBI->connect($dsn, $user, $pass);
  2914.     return $connect;
  2915. } # End LoadMySQLConnection()
  2916.  
  2917.  
  2918. ### Establish a Connection with password from Config File
  2919. sub LoadMySQLConnection_Alternate
  2920. {
  2921.     use DBI;
  2922.     use DBD::mysql;
  2923.  
  2924.     my $DATABASE_NAME       = "XXXXXXXXXXXX";
  2925.     my $DATABASE_USER       = "XXXXXXXXXXXX";
  2926.     my $DATABASE_PASSWORD   = "XXXXXXXXXXXX";
  2927.  
  2928.     if ($DATABASE_PASSWORD eq "XXXXXXXXXXXX")
  2929.     {
  2930.         $client->Message(18, "ERROR! You forgot to update the database password in the sub LoadMySQLConnection2() function!! Search source for XXXXXXXXXXXX to find it.");
  2931.     }
  2932.     else
  2933.     {
  2934.         my $dsn = "DBI:mysql:database=$DATABASE_NAME;host=localhost";
  2935.         my $connect = DBI->connect($dsn, $DATABASE_USER, $DATABASE_PASSWORD);
  2936.         return $connect;
  2937.     }
  2938. } # End LoadMySQLConnection()
  2939.  
  2940.  
  2941. ### Very Simple: Get Qglobal Value and Return it
  2942. sub GET_QGLOBAL_VALUE
  2943. {
  2944.     # if(!$connect) { $connect = LoadMySQLConnection(); }
  2945.     my $connect = LoadMySQLConnection();
  2946.     my $qglobal_name    = $_[0];
  2947.     my $a_name          = "NULL";
  2948.     my $b_value         = "0";
  2949.     my $query           = "SELECT name, value FROM quest_globals WHERE name = '$qglobal_name' LIMIT 1";
  2950.     # quest::gmsay("$query", 18, 0);
  2951.     my $query_handle    = $connect->prepare($query);
  2952.     $query_handle->execute();
  2953.     if ($query_handle->rows)
  2954.     {   # START GET 1 RECORD
  2955.         my $ref     = $query_handle->fetchrow_hashref();
  2956.         $a_name     = $ref->{'name'};
  2957.         $b_value    = $ref->{'value'};
  2958.     }   # END GET 1 RECORD
  2959.     $query_handle->finish();
  2960.     $connect->disconnect();
  2961.     return $b_value;
  2962. } # End GET_QGLOBAL_VALUE()
  2963.  
  2964.  
  2965. ### Check if Qglobal is expired, return 0 for expired, and return 1 for not expired
  2966. ### This is required for SPAM timer to create/delete instances
  2967. sub GET_QGLOBAL_VALUE_EXPIRE
  2968. {
  2969.     # if(!$connect) { $connect = LoadMySQLConnection(); }
  2970.     my $connect = LoadMySQLConnection();
  2971.     my $qglobal_name    = $_[0];
  2972.     my $a_name          = "NULL";
  2973.     my $b_value         = "0";
  2974.     my $c_expdate       = 0;
  2975.     my $query           = "SELECT name, value, expdate FROM quest_globals WHERE name = '$qglobal_name' LIMIT 1";
  2976.     my $query_handle    = $connect->prepare($query);
  2977.     $query_handle->execute();
  2978.  
  2979.     ### EITHER GET RECORD OR RETURN 0 FOR EXPIRED
  2980.     if ($query_handle->rows)
  2981.     {   # START GET 1 RECORD
  2982.         my $ref     = $query_handle->fetchrow_hashref();
  2983.         $a_name     = $ref->{'name'};
  2984.         $b_value    = $ref->{'value'};
  2985.         $c_expdate  = $ref->{'expdate'};
  2986.         $query_handle->finish();
  2987.         $connect->disconnect(); # After getting 1 record, go ahead finish and disconnect, then compare time if expired
  2988.     }   # END GET 1 RECORD
  2989.     else # else no records are retrieved, therefore it doesn't exist and/or expired, return 0
  2990.     {
  2991.         # quest::gmsay("GET_QGLOBAL_VALUE_EXPIRE -1: DOES NOT EXIST!", 18, 0);
  2992.         $query_handle->finish();
  2993.         $connect->disconnect(); # If no record, then finish and disconnect before return
  2994.         return 0;
  2995.     }
  2996.  
  2997.     ### IF RECORD THEN FIND OUT IF THE TIME IS EXPIRED
  2998.     if ($c_expdate > time())
  2999.     {
  3000.         # quest::gmsay("GET_QGLOBAL_VALUE_EXPIRE 1: NOT EXPIRED", 18, 0);
  3001.         return 1;
  3002.     }
  3003.     else
  3004.     {
  3005.         # quest::gmsay("GET_QGLOBAL_VALUE_EXPIRE 0: EXPIRED", 18, 0);
  3006.         return 0;
  3007.     }
  3008. } # End GET_QGLOBAL_VALUE_EXPIRE()
  3009.  
  3010.  
  3011. #################################################################################################################################
  3012. ### START GM ONLY ###############################################################################################################
  3013. sub FIND_PLAYER_INSTANCE
  3014. {
  3015.     my $connect = LoadMySQLConnection(); # Connect to DB
  3016.     my $temp_id = 0;;
  3017.     my $temp_name = "NA";
  3018.     my $temp_x = 0;
  3019.     my $temp_y = 0;
  3020.     my $temp_z = 0;
  3021.     my $temp_zonename = "NA";
  3022.     my $temp_instanceid = 0;
  3023.     my $ZoneSNTOID = 0;
  3024.     my $query           = "SELECT id, name, x, y, z, zonename, instanceid FROM character_ WHERE name = '$_[0]' ORDER BY id DESC LIMIT 1";
  3025.     my $query_handle    = $connect->prepare($query);
  3026.     $query_handle->execute();
  3027.  
  3028.     # GET 1 RECORD
  3029.     if($query_handle->rows)
  3030.     {
  3031.         my $ref             = $query_handle->fetchrow_hashref();
  3032.         $temp_id            = $ref->{'id'};
  3033.         $temp_name          = $ref->{'name'};
  3034.         $temp_x             = $ref->{'x'};
  3035.         $temp_y             = $ref->{'y'};
  3036.         $temp_z             = $ref->{'z'};
  3037.         $temp_zonename      = $ref->{'zonename'};
  3038.         $temp_instanceid    = $ref->{'instanceid'};
  3039.         $ZoneSNTOID         = ListZoneSNToID2($temp_zonename);
  3040.     }
  3041.  
  3042.     $query_handle->finish();
  3043.     $connect->disconnect();
  3044.  
  3045.     if ($temp_name eq "NA")
  3046.     {
  3047.         $client->Message(7, "$_[0] not found!");
  3048.     }
  3049.     else
  3050.     {
  3051.         my $GOTO_PLAYER_LINK = quest::saylink("goto " . $temp_name, 1);
  3052.         $client->Message(7, " ");
  3053.         $client->Message(7, "Info for: $temp_name");
  3054.         $client->Message(7, "Char ID = $temp_id");
  3055.         $client->Message(7, "Char X = $temp_y");
  3056.         $client->Message(7, "Char Y = $temp_x");
  3057.         $client->Message(7, "Char Z = $temp_z");
  3058.         $client->Message(7, "Zone Name = $temp_zonename");
  3059.         $client->Message(7, "Instance ID = $temp_instanceid");
  3060.         $client->Message(7, "$GOTO_PLAYER_LINK");
  3061.     }
  3062. } # End FIND_PLAYER_INSTANCE()
  3063. #################################################################################################################################
  3064. #################################################################################################################################
  3065. sub GOTO_PLAYER_INSTANCE
  3066. {
  3067.     my $connect = LoadMySQLConnection(); # Connect to DB
  3068.     my $temp_id = 0;;
  3069.     my $temp_name = "NA";
  3070.     my $temp_x = 0;
  3071.     my $temp_y = 0;
  3072.     my $temp_z = 0;
  3073.     my $temp_zonename = "NA";
  3074.     my $temp_instanceid = 0;
  3075.     my $ZoneSNTOID = 0;
  3076.     my $query           = "SELECT id, name, x, y, z, zonename, instanceid FROM character_ WHERE name = '$_[0]' ORDER BY id DESC LIMIT 1";
  3077.     my $query_handle    = $connect->prepare($query);
  3078.     $query_handle->execute();
  3079.  
  3080.     # GET 1 RECORD
  3081.     if($query_handle->rows)
  3082.     {
  3083.         my $ref             = $query_handle->fetchrow_hashref();
  3084.         $temp_id            = $ref->{'id'};
  3085.         $temp_name          = $ref->{'name'};
  3086.         $temp_x             = $ref->{'x'};
  3087.         $temp_y             = $ref->{'y'};
  3088.         $temp_z             = $ref->{'z'};
  3089.         $temp_zonename      = $ref->{'zonename'};
  3090.         $temp_instanceid    = $ref->{'instanceid'};
  3091.         $ZoneSNTOID         = ListZoneSNToID2($temp_zonename);
  3092.     }
  3093.  
  3094.     $query_handle->finish();
  3095.     $connect->disconnect();
  3096.  
  3097.     $client->Message(7, " ");
  3098.  
  3099.     if ($temp_instanceid > 0)
  3100.     {
  3101.         $client->Message(7, "$temp_name is in instance id $temp_instanceid.");
  3102.         $client->Message(7, "Zoning to $temp_zonename.");
  3103.         quest::AssignToInstance($temp_instanceid);
  3104.         quest::MovePCInstance($ZoneSNTOID, $temp_instanceid, $temp_x, $temp_y, $temp_z);
  3105.     }
  3106.     elsif ($temp_id > 0)
  3107.     {
  3108.         $client->Message(7, "$temp_name does not have instance.");
  3109.         $client->Message(7, "Zoning to $temp_zonename.");
  3110.         quest::movepc($ZoneSNTOID,$temp_x,$temp_y,$temp_z);
  3111.     }
  3112.     else
  3113.     {
  3114.         $client->Message(7, "Character $_[0] does not exist!");
  3115.     }
  3116.  
  3117. } # End GOTO_PLAYER_INSTANCE()
  3118. ### END GM ONLY #################################################################################################################
  3119. #################################################################################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement