Advertisement
Guest User

Waypoint Code 1.6

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