Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #####################################################################################################################################################
- #####################################################################################################################################################
- ### FILE NAME : global_player.pl
- ### VERSION : 1.9.9
- ### UPDATED : April 3, 2013
- ### QUEST : Create Solo, Raid, and Guild instances with custom invites
- ### REQURIED PLUGIN 1 : globals.pl (plugin::var, plugin::val) for subs to get variable values (Might copy plugins to a sub later)
- ### REQURIED PLUGIN 2 : check_hasitem.pl (plugin::check_hasitem) to determine prices via item
- ### ITEM IDS : 119998 = Waypoint, 120003 = Free Waypoint
- ### QGLOBAL VARIABLE : XXX = Instance ID, YYY = Auto Increment ID
- ### QGLOBAL SOLO : $name_SoloI_$zonesn_$zoneid, $name_RaidI_DELETE_$zonesn_$zoneid, RaidI_Group_$RAIDGROUPID_$zonesn_$zoneid
- ### QGLOBAL RAID : $name_RaidI_$zonesn_$zoneid, XXX_RaidI_Leader, XXX__RaidI_Time, XXX_RaidI_$zonesn_$zoneid, XXX_RaidI_Status_YYY
- ### QGLOBAL GUILD : GuildI_$uguild_ID_$zonesn_$zoneid, XXX_GuildI_$zonesn_$zoneid, XXX_GuildI_Leader,
- ### XXX__GuildI_Time, XXX_GuildI_$zonesn_$zoneid, XXX_GuildI_Status_YYY
- ### QGLOBAL SPAM DELAY : SPAM_SoloI_$name_$zonesn_$zoneid, SPAM_GuildI_$uguild_id_$zonesn_$zoneid, SPAM_RaidI_$name_$zonesn_$zoneid (600 seconds to re-create instances)
- ###
- ### Special Thanks : Used code from Bamron, Hateborne, Natedog, Crab, Trevius, Akkadius, Secrets, and a few other people
- ###
- ### STUFF TO DO :
- ### Add: Time Remaining of instance on Popup window info when creating instance
- ### Edit: change syntax to have symbol ("#" or ".") in front of commands
- ### Maybe Use: my $GuildName = $client->GuildID(); my $GuildName = quest::getguildnamebyid($guildID);
- ### Maybe Use: my $RaidGroup = $client->GetRaid(); my $raidID = $RaidGroup->GetID();
- ### Add: One command from leader to invite/teleport entire guild/raid into the instance
- ###
- ### OTHER NOTES : This code was revamped to use DBI for reading QGlobals
- ###
- ### CHANGES :
- ### 04/03/2013
- ### Added anti spam at top of sub EVENT_SAY
- ### Added Raid Group Members allowed to Raid List
- ### Added / Changed Solo Instance to Group Instance
- ### Added / Changed Raid Instance to automatically allow members of raid group to join
- ### Changed Hunter_Raid_cshome_26 to Hunter_RaidI_cshome_26
- ### Changed Hunter_Guild_cshome_26 to Hunter_GuildI_cshome_26
- ### Changed SPAM_RAID_cshome_Hunter to SPAM_RaidI_cshome_Hunter
- ### Changed SPAM_GUILD_cshome_Hunter to SPAM_GuildI_cshome_Hunter
- ### Changed 5_Guild_cshome_26 to 5_GuildI_cshome_26
- ### Changed solo to SoloI
- ### Prices adjusted (lowered)
- ###
- ### 04/02/2013
- ### Changed SPAM_GUILD_$zonesn_$name to SPAM_GUILD_$zonesn_$uguild_id to prevent other members from re-create
- ### Changed method for getting user/password for DBI
- ### Prevent non-guilded players from making guild instance for id -1
- ### Fixed the ability to invite and remove players into an instance from ANY zone.
- ### Revamped to use DBI to read qglobals since zones don't always refresh memory
- ### Created function with DBI to check for expired qglobals
- ### Updated DBI for GM tools to read user name and password from config file
- ### Make instances all free for now to test new code
- ### Made commons and overthere (pvp zones) to be 999999999 cost as a way of disable instances from those zones
- ### Added quest::AssignToInstance(); to a few more locations
- ###
- ### 04/01/2013
- ### Added ability to invite Raid/Guild members all on one line separated by comma
- ### Added GM commands to "find" and "goto" player which helps to find players and teleport to them in an intstance
- ### Added ListZoneSNToID2() for find and goto GM commands
- ### Added 15 minute delay to delete instances so that player don't delete instance before they can re-create it
- ### Updated Waypoint.pl for adding funds to account, but no menu or instances.
- ###
- ### 03/31/2013
- ### Added Qglobal $name_Guild_$zonesn_$zoneid
- ### guild join and raid join now use <name> instead of <id>
- ### Player gets message of being BANNED when getting banned, or trying to join when banned
- ### Player gets message that you were not invited if trying to join before getting invited
- ### Added command Waypoint to bring up the menu in addition to Instance or Instances
- ### Added Spam Delay Global for Creating Instances in same zone and tell player how many seconds left to create again
- ###
- ### 03/30/2013
- ### Changed menu system, put some commands under the "More Options" saylink to reduce menu size
- ### Changed instance durations from 14400 to 259200 (4 hrs to 72 hrs)
- ### Updated prices and per zone and per type
- ### Created sub zone id to zone name (Hope I didn't re-create something that already exist lol)
- ### Added $zoneid to $zonesn in qglobal name and passed to $signal, telling players in a different zone which zone to be used
- ### $signal remove - greater than 1000000000 (1 billion) = remove player from instance
- ### $signal zone id - has $zoneid * 1000000 (1 million) for $zoneid to pass through signal via int ($signal / 1000000)
- ### $signal instance id - has instance id passed by int ($signal % 1000000) to get the value under 1 million for instance id
- ### Updated signal to give message to player that was invited regardless of any status (pending, joined, removed)
- ### Added with the above update, players can re-invite players that did not receive the message or was zoning at the time, etc.
- ### Updated Popup window info when being invited, removed, or choosing to leave instance
- #####################################################################################################################################################
- #####################################################################################################################################################
- sub EVENT_SAY
- {
- # Name of each spam
- my $time_delay_1 = "$name" . "SayDelay1";
- my $time_delay_2 = "$name" . "SayDelay2";
- my $time_delay_3 = "$name" . "SayDelay3";
- my $time_delay_4 = "$name" . "SayDelay4";
- my $time_delay_5 = "$name" . "SayDelay5";
- # Check the spam queue, and fill if empty
- if (!defined($qglobals{$time_delay_1})) { quest::setglobal("$time_delay_1","SPAM1","1","S10"); } # All NPC, This Player, This Zone, 10 Seconds
- elsif (!defined($qglobals{$time_delay_2})) { quest::setglobal("$time_delay_2","SPAM2","1","S10"); } # All NPC, This Player, This Zone, 10 Seconds
- elsif (!defined($qglobals{$time_delay_3})) { quest::setglobal("$time_delay_3","SPAM3","1","S10"); } # All NPC, This Player, This Zone, 10 Seconds
- elsif (!defined($qglobals{$time_delay_4})) { quest::setglobal("$time_delay_4","SPAM4","1","S10"); } # All NPC, This Player, This Zone, 10 Seconds
- elsif (!defined($qglobals{$time_delay_5})) { quest::setglobal("$time_delay_5","SPAM5","1","S10"); } # All NPC, This Player, This Zone, 10 Seconds
- else
- {
- $client->Message(15,"$name please slow down before you get banned!");
- my $spam_name = "SPAM_COUNT_" . $name;
- my $spam_count = 1 + $qglobals{$spam_name};
- quest::setglobal("$spam_name","$spam_count","7","F"); # Keep record of spam count
- }
- # If spam queue is not full, then allow say
- if (!defined($qglobals{$time_delay_1}) || !defined($qglobals{$time_delay_2}) ||
- !defined($qglobals{$time_delay_3}) || !defined($qglobals{$time_delay_4}) ||
- !defined($qglobals{$time_delay_5}))
- {
- ###############################################################################################
- # START GM COMMAND ############################################################################
- # Find if player is in an instance, other info, etc before trying to goto them
- if ($text=~/^find/i && $status > 150)
- {
- my $lostperson = substr($text, 5);
- FIND_PLAYER_INSTANCE($lostperson);
- }
- # Can goto player last known zone/instance and XYZ position via DBI and character_ table
- # Useful for finding players when they belong to many instances
- if ($text=~/^goto/i && $status > 150)
- {
- my $lostperson = substr($text, 5);
- GOTO_PLAYER_INSTANCE($lostperson);
- }
- # END GM COMMAND ##############################################################################
- ###############################################################################################
- my $SoloStatus = 1;
- my $GuildStatus = 1;
- my $RaidStatus = 1;
- if ($text=~/^Instance$/i || $text=~/^Instances$/i || $text=~/^Waypoint$/i)
- {
- my $freeinstance = plugin::check_hasitem($client, 120003); #EDIT item ID for FREE instance item
- my $paidinstance = plugin::check_hasitem($client, 119998); #EDIT item ID for PAID instance item
- $client->Message(315," ");
- if ($freeinstance)
- {
- $client->Message(315,"Free Waypoint Menu");
- $client->Message(315,"------------------------------");
- }
- elsif ($paidinstance)
- {
- $client->Message(315,"Reglar Waypoint Menu");
- $client->Message(315,"---------------------------------");
- }
- else
- {
- $client->Message(315,"Non Discount Waypoint Menu");
- $client->Message(315,"-------------------------------------------");
- }
- }
- ###############################################################################################
- ### START SOLO INSTANCES ######################################################################
- if ($SoloStatus == 1)
- {
- if ($text=~/^Instance$/i || $text=~/^Instances$/i || $text=~/^Waypoint$/i)
- {
- my $SoloInstanceID = "$name" . "_SoloI_" . "$zonesn" . "_" . "$zoneid";
- if (GET_QGLOBAL_VALUE("$SoloInstanceID"))
- {
- my $EnterSoloInstance = quest::saylink("Enter Solo", 1);
- my $DeleteSoloInstance = quest::saylink("Delete Solo", 1);
- $client->Message(315,"[$EnterSoloInstance] [$DeleteSoloInstance]");
- }
- else
- {
- my $SoloCreate = quest::saylink("Create Solo Instance", 1);
- my $SoloCost = SOLO_PRICE();
- $client->Message(315,"[$SoloCreate] : $SoloCost Platinum");
- }
- $qglobals{"$SoloInstanceID"} = undef;
- }
- if($text=~/^Create Solo Instance$/i)
- {
- my $SoloInstanceID = "$name" . "_SoloI_" . "$zonesn" . "_" . "$zoneid";
- if (GET_QGLOBAL_VALUE("$SoloInstanceID"))
- {
- $client->Message(315,"You already have a Solo instance for $zonesn.");
- }
- else
- {
- my $accountid = $client->AccountID();
- my $bankcredit = GET_QGLOBAL_VALUE("BankCredit_$accountid");
- my $SoloCost = SOLO_PRICE();
- my $cost = $SoloCost;
- my $SPAM_NAME = "SPAM_SoloI_" . $name . "_$zonesn" . "_$zoneid";
- my $SPAM_TIME = 600; # Make 3600 / 1 HR
- if ($bankcredit < $cost)
- {
- $client->Message(315,"You need ". ($cost - $bankcredit) . " more plat!");
- }
- elsif (GET_QGLOBAL_VALUE_EXPIRE("$SPAM_NAME"))
- {
- my $SPAM_VALUE = GET_QGLOBAL_VALUE("$SPAM_NAME");
- my $TIME_LEFT = $SPAM_TIME + $SPAM_VALUE - time();
- $client->Message(315,"You can create another Solo Instance in $TIME_LEFT seconds.");
- }
- else
- {
- quest::setglobal("$SPAM_NAME",time(),"7","S$SPAM_TIME"); # PREVENT CREATE SPAM FOR THIS ZONE
- PayInstance("BankCredit", $cost, "Solo Instance");
- my $InstVersion = 0; # Must be 0 to load NPCs into an instance
- my $InstanceDuration = 259200;
- my $EnterSoloInstance = quest::saylink("Enter Solo", 1);
- my $InstID = quest::CreateInstance("$zonesn", $InstVersion, $InstanceDuration);
- quest::setglobal("$SoloInstanceID","$InstID","7","S$InstanceDuration");
- quest::AssignToInstance($InstID);
- $client->Message(315,"You created a solo instance ($InstID) for $zonesn.");
- my $ClientGroup = $client->GetGroup();
- if (defined($ClientGroup))
- {
- # $Group->GroupMessage($name, "type: /say solo join $name"); # NOT WORKING?
- my $SoloGroupID = "$name" . "_SoloI_GroupID_" . "$zonesn" . "_" . "$zoneid";
- my $groupID = $ClientGroup->GetID();
- quest::setglobal("$SoloGroupID","$groupID","7","S$InstanceDuration");
- quest::AssignGroupToInstance($InstID); # Add / Assign group to instance for when they join via solo join
- $client->Message(315,"Your group was added to solo instance ($InstID) for $zonesn.");
- $client->Message(315,"Tell your group to /say solo join $name");
- $qglobals{"$SoloGroupID"} = undef;
- }
- $client->Message(315,"Would you like to $EnterSoloInstance instance?");
- } # create instance then send
- $qglobals{"$SPAM_NAME"} = undef;
- }
- $qglobals{"$SoloInstanceID"} = undef;
- }
- if($text=~/^Enter Solo$/i)
- {
- my $SoloInstanceID = "$name" . "_SoloI_" . "$zonesn" . "_" . "$zoneid";
- if (GET_QGLOBAL_VALUE("$SoloInstanceID"))
- {
- my $timestamp = localtime(time);
- my $InstID = GET_QGLOBAL_VALUE("$SoloInstanceID");
- my $Cx = $client->GetX();
- my $Cy = $client->GetY();
- my $Cz = $client->GetZ();
- quest::popup("ENTER SOLO INSTANCE","<br>
- <c \"#FE2E2E\">Moving you to SOLO instance!<br>
- <br>
- <c \"#FFFF49\">Time : <c \"#00FF00\">$timestamp<br>
- <c \"#FFFF49\">Name : <c \"#00FF00\">$name<br>
- <c \"#FFFF49\">Zone : <c \"#00FF00\">$zonesn<br>
- <c \"#FFFF49\">Type : <c \"#00FF00\">Solo<br>
- <br>
- <c \"#00BFFF\">ENJOY!<br>
- <br>
- <br>
- ",1050,0);
- $client->Message(315, " ");
- $client->Message(315, "Moving you to solo instance ($InstID) for $zonesn.");
- quest::AssignToInstance($InstID);
- quest::MovePCInstance($zoneid, $InstID, $Cx, $Cy, $Cz);
- }
- else
- {
- $client->Message(315,"You do not have a solo instance for $zonesn.");
- } # create instance then send
- $qglobals{"$SoloInstanceID"} = undef;
- }
- ### JOIN SOLO INSTANCE ##################################################################
- if($text=~/^solo join /i)
- {
- my $Check_S_Leader = substr($text, 10);
- my $SoloInstanceID = "$Check_S_Leader" . "_SoloI_" . "$zonesn" . "_" . "$zoneid";
- my $SoloGroupID = "$Check_S_Leader" . "_SoloI_GroupID_" . "$zonesn" . "_" . "$zoneid";
- my $ClientGroup = $client->GetGroup();
- if (defined($ClientGroup))
- {
- my $groupID = $ClientGroup->GetID();
- if ($groupID == GET_QGLOBAL_VALUE("$SoloGroupID"))
- {
- my $timestamp = localtime(time);
- my $InstID = GET_QGLOBAL_VALUE("$SoloInstanceID");
- my $Cx = $client->GetX();
- my $Cy = $client->GetY();
- my $Cz = $client->GetZ();
- $client->Message(315, "Moving you to $Check_S_Leader Solo (Group) Instance ($InstID) for $zonesn.");
- quest::MovePCInstance($zoneid, $InstID, $Cx, $Cy, $Cz);
- }
- else
- {
- $client->Message(315, "You do not belong to $Check_S_Leader Solo (Group) Instance for $zonesn.");
- }
- $qglobals{"$SoloGroupID"} = undef;
- $qglobals{"$SoloInstanceID"} = undef;
- }
- else
- {
- $client->Message(315, "You are not in a group.");
- }
- } # End if solo join <name>
- if ($text=~/^Delete Solo$/i)
- {
- my $SoloInstanceID = "$name" . "_SoloI_" . "$zonesn" . "_" . "$zoneid";
- my $SoloGroupID = "$name" . "_SoloI_GroupID_" . "$zonesn" . "_" . "$zoneid";
- if (GET_QGLOBAL_VALUE("$SoloInstanceID"))
- {
- $client->Message(315," ");
- my $SPAM_NAME = "SPAM_SoloI_" . $name . "_$zonesn" . "_$zoneid";
- my $SPAM_TIME = 600; # Make 3600 / 1 HR
- if (GET_QGLOBAL_VALUE_EXPIRE("$SPAM_NAME"))
- {
- my $SPAM_VALUE = GET_QGLOBAL_VALUE("$SPAM_NAME");
- my $TIME_LEFT = $SPAM_TIME + $SPAM_VALUE - time();
- $client->Message(315,"You can't delete Solo Instance for $TIME_LEFT more seconds.");
- }
- else
- {
- my $InstID = GET_QGLOBAL_VALUE("$SoloInstanceID");
- quest::DestroyInstance($InstID);
- quest::delglobal($SoloInstanceID);
- quest::delglobal($SoloGroupID);
- $client->Message(315, "Solo Instance ($InstID) Deleted!");
- }
- }
- else
- {
- $client->Message(315, "You do not have a solo instance to delete!");
- }
- $qglobals{"$SoloInstanceID"} = undef;
- $qglobals{"$SoloGroupID"} = undef;
- }
- }
- ### END SOLO INSTANCES #######################################################################
- ###############################################################################################
- ###############################################################################################
- ### START RAID INSTANCES #####################################################################
- if ($RaidStatus == 1)
- {
- if ($text=~/^Instance$/i || $text=~/^Instances$/i || $text=~/^Waypoint$/i)
- {
- my $RaidID = $name;
- my $RaidInstanceID = "$RaidID" . "_RaidI_" . "$zonesn" . "_" . "$zoneid";
- my $RaidGroup = $client->GetRaid();
- my $Raid_Group_Global_Name = "RaidI_Group_";
- if (defined($RaidGroup))
- {
- my $raidID = $RaidGroup->GetID();
- $Raid_Group_Global_Name = "RaidI_Group_" . $raidID . "_$zonesn" . "_$zoneid";
- }
- if (GET_QGLOBAL_VALUE("$RaidInstanceID") || GET_QGLOBAL_VALUE("$Raid_Group_Global_Name"))
- {
- my $EnterRaidInstance = quest::saylink("Enter Raid", 1);
- my $DeleteRaidInstance = quest::saylink("Delete Raid", 1);
- my $RaidList = quest::saylink("Raid List", 1);
- $client->Message(315,"[$EnterRaidInstance] [$DeleteRaidInstance] [$RaidList]");
- }
- else
- {
- my $RaidCreate = quest::saylink("Create Raid Instance", 1);
- my $RaidCost = RAID_PRICE();
- $client->Message(315,"[$RaidCreate] : $RaidCost Platinum");
- }
- $qglobals{"$RaidInstanceID"} = undef;
- }
- if($text=~/^Create Raid Instance$/i)
- {
- # my $RaidID = $name;
- my $RaidInstanceID = "$name" . "_RaidI_" . "$zonesn" . "_" . "$zoneid";
- my $RaidGroup = $client->GetRaid();
- my $Raid_Group_Global_Name = "RaidI_Group_";
- if (defined($RaidGroup))
- {
- my $raidID = $RaidGroup->GetID();
- $Raid_Group_Global_Name = "RaidI_Group_" . $raidID . "_$zonesn" . "_$zoneid";
- }
- if (GET_QGLOBAL_VALUE("$RaidInstanceID") || GET_QGLOBAL_VALUE("$Raid_Group_Global_Name"))
- {
- $client->Message(315,"You already have or belong to a Raid Instance for $zonesn.");
- }
- else
- {
- my $accountid = $client->AccountID();
- my $bankcredit = GET_QGLOBAL_VALUE("BankCredit_$accountid");
- my $RaidCost = RAID_PRICE();
- my $cost = $RaidCost;
- my $SPAM_NAME = "SPAM_RaidI_" . $name . "_" . $zonesn . "_" . $zoneid;
- my $SPAM_TIME = 600; # Make 3600 / 1 HR
- if ($bankcredit < $cost)
- {
- $client->Message(315,"You need ". ($cost - $bankcredit) . " more plat!");
- }
- elsif (GET_QGLOBAL_VALUE_EXPIRE("$SPAM_NAME"))
- {
- my $SPAM_VALUE = GET_QGLOBAL_VALUE("$SPAM_NAME");
- my $TIME_LEFT = $SPAM_TIME + $SPAM_VALUE - time();
- $client->Message(315,"You can create another Raid Instance in $TIME_LEFT seconds.");
- }
- else
- {
- quest::setglobal("$SPAM_NAME",time(),"7","S$SPAM_TIME"); # PREVENT CREATE SPAM FOR THIS ZONE
- PayInstance("BankCredit", $cost, "Raid Instance");
- my $InstVersion = 0; # Must be 0 to load NPCs in an instance
- my $InstanceDuration = 259200;
- my $EnterRaidInstance = quest::saylink("Enter Raid", 1);
- my $InstID = quest::CreateInstance("$zonesn", $InstVersion, $InstanceDuration);
- my $LeaderZone = $InstID . "_RaidI_" . $zonesn . "_" . "$zoneid"; # Qglobal name for Raid Instance ID + zone to do raid invites
- quest::setglobal("$LeaderZone","$InstID","7","S$InstanceDuration"); # Qglobal name for Raid Instance ID + zone to do raid invites
- my $LeaderName = $InstID . "_RaidI_Leader"; # Qglobal Instance/Zone ID to Leaders Name
- quest::setglobal("$LeaderName","$name","7","S$InstanceDuration"); # Qglobal Instance/Zone ID to Leaders Name
- my $LeaderTime = $InstID . "_RaidI_Time"; # Qglobal Raid Instance Timer
- my $Expire_Time = time() + $InstanceDuration; # Qglobal Raid Instance Timer
- quest::setglobal("$LeaderTime","$Expire_Time","7","S$InstanceDuration"); # Qglobal Raid Instance Timer
- # my $RaidGroup = $client->GetRaid(); # $RaidGroup Moved to top of this function
- if (defined($RaidGroup))
- {
- my $raidID = $RaidGroup->GetID();
- $Raid_Group_Global_Name = "RaidI_Group_" . $raidID . "_$zonesn" . "_$zoneid"; # Qglobal Instance/Zone ID to Leaders Name
- my $Raid_DELETE = "$name" . "_RaidI_DELETE_" . "$zonesn" . "_" . "$zoneid"; # Qglobal Instance/Zone ID to DELETE
- quest::setglobal("$Raid_Group_Global_Name","$InstID","7","S$InstanceDuration"); # Qglobal Raid Instance Timer
- quest::setglobal("$Raid_DELETE","$Raid_Group_Global_Name","7","S$InstanceDuration"); # Qglobal Raid Instance DELETE
- $qglobals{"$Raid_Group_Global_Name"} = undef;
- }
- quest::setglobal("$RaidInstanceID","$InstID","7","S$InstanceDuration"); # Qglobal Set Raid Instance ID
- quest::AssignToInstance($InstID);
- $client->Message(315,"You created a Raid Instance ($InstID) for $zonesn.");
- $client->Message(315,"Would you like to $EnterRaidInstance instance?");
- $qglobals{"$LeaderZone"} = undef;
- $qglobals{"$LeaderName"} = undef;
- } # create instance then send
- $qglobals{"$SPAM_NAME"} = undef;
- }
- $qglobals{"$RaidInstanceID"} = undef;
- }
- if($text=~/^Enter Raid$/i)
- {
- my $RaidInstanceID = "$name" . "_RaidI_" . "$zonesn" . "_" . "$zoneid";
- my $RaidGroup = $client->GetRaid();
- my $Raid_Group_Global_Name = "RaidI_Group_";
- if (defined($RaidGroup))
- {
- my $raidID = $RaidGroup->GetID();
- $Raid_Group_Global_Name = "RaidI_Group_" . $raidID . "_$zonesn" . "_$zoneid";
- }
- if (GET_QGLOBAL_VALUE("$RaidInstanceID") || GET_QGLOBAL_VALUE("$Raid_Group_Global_Name"))
- {
- my $timestamp = localtime(time);
- my $InstID = 0;
- if (GET_QGLOBAL_VALUE("$RaidInstanceID")) { $InstID = GET_QGLOBAL_VALUE("$RaidInstanceID"); }
- elsif (GET_QGLOBAL_VALUE("$Raid_Group_Global_Name")) { $InstID = GET_QGLOBAL_VALUE("$Raid_Group_Global_Name"); }
- else { $client->Message(315, "Raid Group ID Error!!"); }
- my $Cx = $client->GetX();
- my $Cy = $client->GetY();
- my $Cz = $client->GetZ();
- quest::popup("ENTER RAID INSTANCE","<br>
- <c \"#FE2E2E\">Moving you to a RAID instance!<br>
- <br>
- <c \"#FFFF49\">Time : <c \"#00FF00\">$timestamp<br>
- <c \"#FFFF49\">Name : <c \"#00FF00\">$name<br>
- <c \"#FFFF49\">Zone : <c \"#00FF00\">$zonesn<br>
- <c \"#FFFF49\">Type : <c \"#00FF00\">Raid<br>
- <br>
- <c \"#00BFFF\">ENJOY!<br>
- <br>
- ",1050,0);
- $client->Message(315, " ");
- $client->Message(315, "Moving you to Raid Instance ($InstID) for $zonesn.");
- quest::AssignToInstance($InstID);
- quest::MovePCInstance($zoneid, $InstID, $Cx, $Cy, $Cz);
- }
- else
- {
- $client->Message(315,"You do not have a Raid Instance for $zonesn.");
- } # create instance then send
- $qglobals{"$RaidInstanceID"} = undef;
- }
- if ($text=~/^Delete Raid$/i)
- {
- $client->Message(315, " ");
- my $RaidInstanceID = "$name" . "_RaidI_" . "$zonesn" . "_" . "$zoneid";
- if (GET_QGLOBAL_VALUE("$RaidInstanceID"))
- {
- my $SPAM_NAME = "SPAM_RaidI_" . $name . "_" . $zonesn . "_" . $zoneid;
- my $SPAM_TIME = 600; # Make 3600 / 1 HR
- if (GET_QGLOBAL_VALUE_EXPIRE("$SPAM_NAME"))
- {
- my $SPAM_VALUE = GET_QGLOBAL_VALUE("$SPAM_NAME");
- my $TIME_LEFT = $SPAM_TIME + $SPAM_VALUE - time();
- $client->Message(315,"You can't delete Raid Instance for $TIME_LEFT more seconds.");
- }
- else
- {
- my $InstID = GET_QGLOBAL_VALUE("$RaidInstanceID");
- my $Raid_DELETE = "$name" . "_RaidI_DELETE_" . "$zonesn" . "_" . "$zoneid"; # Qglobal Instance/Zone ID to DELETE
- my $LeaderZone = $InstID . "_RaidI_" . $zonesn . "_" . "$zoneid"; # Qglobal name for charid + zonesn to invite raid
- my $LeaderName = $InstID . "_RaidI_Leader"; # Qglobal ID to Name
- my $LeaderTime = $InstID . "_RaidI_Time"; # Qglobal Time
- # DELETE Raid Player Invited List
- my $count = 1;
- my $raid_invite_name = $InstID . "_RaidI_Status_";
- my $temp_del = "";
- while ($count > 0)
- {
- if (GET_QGLOBAL_VALUE("$raid_invite_name$count"))
- {
- $temp_del = $raid_invite_name . $count;
- quest::delglobal($temp_del);
- $count ++;
- }
- else
- {
- $count = $count - 1;
- # quest::gmsay("GM: Deleted $count Invited Players!", 18, 0);
- $count = 0;
- }
- }
- # END DELETE Raid Player Invited List
- $client->Message(315, "Raid Instance ($InstID) Deleted!");
- quest::DestroyInstance($InstID);
- quest::delglobal($RaidInstanceID);
- quest::delglobal($LeaderZone);
- quest::delglobal($LeaderName);
- quest::delglobal($LeaderTime);
- my $Raid_DELETE = "$name" . "_RaidI_DELETE_" . "$zonesn" . "_" . "$zoneid"; # Qglobal Instance/Zone ID to DELETE
- if (GET_QGLOBAL_VALUE("$Raid_DELETE"))
- {
- my $DELETE_THIS_RAID_GROUP = GET_QGLOBAL_VALUE("$Raid_DELETE");
- quest::delglobal($Raid_DELETE);
- quest::delglobal($DELETE_THIS_RAID_GROUP);
- }
- my $RaidGroup = $client->GetRaid();
- my $Raid_Group_Global_Name = "RaidI_Group_";
- if (defined($RaidGroup))
- {
- my $raidID = $RaidGroup->GetID();
- $Raid_Group_Global_Name = "RaidI_Group_" . $raidID . "_$zonesn" . "_$zoneid";
- quest::delglobal($Raid_Group_Global_Name);
- $qglobals{"$Raid_Group_Global_Name"} = undef;
- }
- $qglobals{"$LeaderZone"} = undef;
- $qglobals{"$LeaderName"} = undef;
- $qglobals{"$LeaderTime"} = undef;
- }
- }
- else
- {
- $client->Message(315, "You do not have (or are not leader of) a Raid Instance to delete!");
- }
- $qglobals{"$RaidInstanceID"} = undef;
- }
- }
- ### END RAID INSTANCES ######################################################################
- ###############################################################################################
- ###############################################################################################
- ### START GUILD INSTANCES #####################################################################
- if ($GuildStatus == 1)
- {
- if ($text=~/^Instance$/i || $text=~/^Instances$/i || $text=~/^Waypoint$/i)
- {
- my $GuildID = $uguild_id;
- my $GuildInstanceID = "GuildI_" . "$GuildID" . "_$zonesn" . "_$zoneid";
- if (GET_QGLOBAL_VALUE("$GuildInstanceID"))
- {
- my $EnterGuildInstance = quest::saylink("Enter Guild", 1);
- my $DeleteGuildInstance = quest::saylink("Delete Guild", 1);
- my $GuildList = quest::saylink("Guild List", 1);
- $client->Message(315,"[$EnterGuildInstance] [$DeleteGuildInstance] [$GuildList]");
- }
- else
- {
- my $GuildCreate = quest::saylink("Create Guild Instance", 1);
- my $GuildCost = GUILD_PRICE();
- $client->Message(315,"[$GuildCreate] : $GuildCost Platinum");
- }
- $qglobals{"$GuildInstanceID"} = undef;
- }
- if($text=~/^Create Guild Instance$/i && $uguild_id < 1)
- {
- $client->Message(315,"You do not belong to any guild!");
- }
- if($text=~/^Create Guild Instance$/i && $uguild_id > 0)
- {
- my $GuildID = $uguild_id;
- my $GuildInstanceID = "GuildI_" . "$GuildID" . "_$zonesn" . "_$zoneid"; # Unique Guild Instance via Guild ID
- my $GuildInstanceID2 = "$name" . "_GuildI_" . $zonesn . "_$zoneid"; # Who created Guild Instance, used for Invites
- if (GET_QGLOBAL_VALUE("$GuildInstanceID"))
- {
- $client->Message(315,"You already have a Guild Instance for $zonesn.");
- }
- else
- {
- my $accountid = $client->AccountID();
- my $bankcredit = GET_QGLOBAL_VALUE("BankCredit_$accountid");
- my $GuildCost = GUILD_PRICE();
- my $cost = $GuildCost;
- my $SPAM_NAME = "SPAM_GuildI_" . $uguild_id . "_" . $zonesn . "_" . $zoneid;
- my $SPAM_TIME = 600; # Make 3600 / 1 HR
- if ($bankcredit < $cost)
- {
- $client->Message(315,"You need ". ($cost - $bankcredit) . " more plat!");
- }
- elsif (GET_QGLOBAL_VALUE_EXPIRE("$SPAM_NAME"))
- {
- my $SPAM_VALUE = GET_QGLOBAL_VALUE("$SPAM_NAME");
- my $TIME_LEFT = $SPAM_TIME + $SPAM_VALUE - time();
- $client->Message(315,"You can create another Guild Instance in $TIME_LEFT seconds.");
- }
- else
- {
- quest::setglobal("$SPAM_NAME",time(),"7","S$SPAM_TIME"); # PREVENT CREATE SPAM FOR THIS ZONE
- PayInstance("BankCredit", $cost, "Guild Instance");
- my $InstVersion = 0; # MUST be 0 to load NPCs in an instance!
- my $InstanceDuration = 259200;
- my $EnterGuildInstance = quest::saylink("Enter Guild", 1);
- my $InstID = quest::CreateInstance("$zonesn", $InstVersion, $InstanceDuration);
- my $LeaderZone = $InstID . "_GuildI_" . $zonesn . "_" . "$zoneid"; # Qglobal name for Guild Instance ID + zone to do guild invites
- quest::setglobal("$LeaderZone","$InstID","7","S$InstanceDuration"); # Qglobal name for Guild Instance ID + zone to do guild invites
- my $LeaderName = $InstID . "_GuildI_Leader"; # Qglobal Instance/Zone ID to Leaders Name
- quest::setglobal("$LeaderName","$name","7","S$InstanceDuration"); # Qglobal Instance/Zone ID to Leaders Name
- my $LeaderTime = $InstID . "_GuildI_Time"; # Qglobal Guild Instance Timer
- my $Expire_Time = time() + $InstanceDuration; # Qglobal Guild Instance Timer
- quest::setglobal("$LeaderTime","$Expire_Time","7","S$InstanceDuration"); # Qglobal Guild Instance Timer
- quest::setglobal("$GuildInstanceID","$InstID","7","S$InstanceDuration"); # Qglobal Set Guild Instance ID
- quest::setglobal("$GuildInstanceID2","$InstID","7","S$InstanceDuration"); # Qglobal Set Guild Instance ID 2
- quest::AssignToInstance($InstID);
- $client->Message(315,"You created a Guild Instance ($InstID) for $zonesn.");
- $client->Message(315,"Would you like to $EnterGuildInstance instance?");
- $qglobals{"$LeaderZone"} = undef;
- $qglobals{"$LeaderName"} = undef;
- } # create instance then send
- $qglobals{"$SPAM_NAME"} = undef;
- }
- $qglobals{"$GuildInstanceID"} = undef;
- $qglobals{"$GuildInstanceID2"} = undef;
- }
- if($text=~/^Enter Guild$/i)
- {
- my $GuildID = $uguild_id;
- my $GuildInstanceID = "GuildI_" . "$GuildID" . "_$zonesn" . "_$zoneid";
- if (GET_QGLOBAL_VALUE("$GuildInstanceID"))
- {
- my $timestamp = localtime(time);
- my $InstID = GET_QGLOBAL_VALUE("$GuildInstanceID");
- my $Cx = $client->GetX();
- my $Cy = $client->GetY();
- my $Cz = $client->GetZ();
- quest::popup("ENTER GUILD INSTANCE","<br>
- <c \"#FE2E2E\">Moving you to a GUILD instance!<br>
- <br>
- <c \"#FFFF49\">Time : <c \"#00FF00\">$timestamp<br>
- <c \"#FFFF49\">Name : <c \"#00FF00\">$name<br>
- <c \"#FFFF49\">Zone : <c \"#00FF00\">$zonesn<br>
- <c \"#FFFF49\">Type : <c \"#00FF00\">Guild<br>
- <br>
- <c \"#00BFFF\">ENJOY!<br>
- <br>
- ",1050,0);
- $client->Message(315, " ");
- $client->Message(315, "Moving you to Guild Instance ($InstID) for $zonesn.");
- quest::AssignToInstance($InstID);
- quest::MovePCInstance($zoneid, $InstID, $Cx, $Cy, $Cz);
- }
- else
- {
- $client->Message(315,"You do not have a Guild Instance for $zonesn.");
- } # create instance then send
- $qglobals{"$GuildInstanceID"} = undef;
- }
- if ($text=~/^Delete Guild$/i)
- {
- $client->Message(315, " ");
- my $GuildID = $uguild_id;
- my $GuildInstanceID = "GuildI_" . "$GuildID" . "_$zonesn" . "_$zoneid";
- my $GuildInstanceID2 = "$name" . "_GuildI_" . $zonesn . "_$zoneid";
- if (GET_QGLOBAL_VALUE("$GuildInstanceID"))
- {
- my $SPAM_NAME = "SPAM_GuildI_" . $uguild_id . "_" . $zonesn . "_" . $zoneid;
- my $SPAM_TIME = 600; # Make 3600 / 1 HR
- if (GET_QGLOBAL_VALUE_EXPIRE("$SPAM_NAME"))
- {
- my $SPAM_VALUE = GET_QGLOBAL_VALUE("$SPAM_NAME");
- my $TIME_LEFT = $SPAM_TIME + $SPAM_VALUE - time();
- $client->Message(315,"You can't delete Guild Instance for $TIME_LEFT more seconds.");
- }
- else
- {
- my $InstID = GET_QGLOBAL_VALUE("$GuildInstanceID");
- my $LeaderZone = $InstID . "_GuildI_" . $zonesn . "_" . "$zoneid";
- my $LeaderName = $InstID . "_GuildI_Leader";
- my $LeaderTime = $InstID . "_GuildI_Time";
- # DELETE List of Players Invited to Guild Instance
- my $count = 1;
- my $guild_invite_name = $InstID . "_GuildI_Status_";
- my $temp_del = "";
- while ($count > 0)
- {
- if (GET_QGLOBAL_VALUE("$guild_invite_name$count"))
- {
- $temp_del = $guild_invite_name . $count;
- quest::delglobal($temp_del);
- $count ++;
- }
- else
- {
- $count = $count - 1;
- # quest::gmsay("GM: Deleted $count Invited Players!", 18, 0);
- $count = 0;
- }
- }
- # END DELETE List of Players Invited to Guild Instance
- quest::DestroyInstance($InstID);
- quest::delglobal($GuildInstanceID);
- quest::delglobal($GuildInstanceID2);
- quest::delglobal($LeaderZone);
- quest::delglobal($LeaderName);
- quest::delglobal($LeaderTime);
- $client->Message(315, "Guild Instance ($InstID) Deleted!");
- $qglobals{"$LeaderZone"} = undef;
- $qglobals{"$LeaderName"} = undef;
- $qglobals{"$LeaderTime"} = undef;
- }
- }
- else
- {
- $client->Message(315, "You do not have a Guild Instance to delete!");
- }
- $qglobals{"$GuildInstanceID"} = undef;
- $qglobals{"$GuildInstanceID2"} = undef;
- }
- }
- ### END GUILD INSTANCES ######################################################################
- ###############################################################################################
- if ($text=~/^Instance$/i || $text=~/^Instances$/i || $text=~/^Waypoint$/i)
- {
- my $LeaveInstance = quest::saylink("Leave Instance", 1);
- my $MoreOptions = quest::saylink("More Options", 1);
- $client->Message(315, "[$LeaveInstance] [$MoreOptions]");
- }
- if($text=~/^Guild Invite$/i)
- {
- $client->Message(315, " ");
- $client->Message(315, "Syntax: guild invite <Player Name>");
- }
- if($text=~/^Raid Invite$/i)
- {
- $client->Message(315, " ");
- $client->Message(315, "Syntax: raid invite <Player Name>");
- }
- # INVITE Guild Member
- if($text=~/^Guild Invite /i && $text ne "Guild Invite")
- {
- my $GuildID = $uguild_id;
- my $GuildInstanceID = "GuildI_" . "$GuildID" . "_$zonesn" . "_$zoneid";
- ##########################################################################################################################
- ### NEW INVITE CODE MULTIPLE NAME INVITE SPLIT BY COMMA
- ##########################################################################################################################
- if (GET_QGLOBAL_VALUE("$GuildInstanceID"))
- {
- my $GetFriendName = substr($text, 13);
- my @FriendNames = split(',', $GetFriendName); #Split the names into an array by comma
- my $Instance_Invite = 0 + GET_QGLOBAL_VALUE("$GuildInstanceID");
- my $ZoneConvert = $zoneid * 1000000; # Include Zone ID in the Signal, multiple of 1 million (1-999 Million)
- my $Instance_Invite_Convert = $Instance_Invite + $ZoneConvert;
- #Loop through the array of Names to invite
- foreach my $FriendName (@FriendNames)
- {
- $FriendName =~ s/^\s+|\s+$//g; #Strip spaces from the beginning or end of the name
- quest::crosszonesignalclientbyname($FriendName, $Instance_Invite_Convert);
- $client->Message(315, " ");
- $client->Message(315, "You sent an invite to $FriendName to join Guild Instance ($Instance_Invite) in $zonesn.");
- # $client->Message(315, "You sent an invite to $FriendName to join instance ($Instance_Invite) in $zonesn.");
- }
- }
- ##########################################################################################################################
- else
- {
- $client->Message(315, " ");
- $client->Message(315, "You do not have a Guild Instance for inviting.");
- }
- $qglobals{"$GuildInstanceID"} = undef;
- }
- # INVITE Raid Member
- if($text=~/^Raid Invite /i && $text ne "Raid Invite")
- {
- my $RaidID = $name;
- my $RaidInstanceID = "$RaidID" . "_RaidI_" . "$zonesn" . "_" . "$zoneid";
- ##########################################################################################################################
- ### NEW INVITE CODE MULTIPLE NAME INVITE SPLIT BY COMMA
- ##########################################################################################################################
- if (GET_QGLOBAL_VALUE("$RaidInstanceID"))
- {
- my $GetFriendName = substr($text, 12);
- my @FriendNames = split(',', $GetFriendName); #Split the names into an array by comma
- my $Instance_Invite = 0 + GET_QGLOBAL_VALUE("$RaidInstanceID");
- my $ZoneConvert = $zoneid * 1000000; # Include Zone ID in the Signal, multiple of 1 million (1-999 Million)
- my $Instance_Invite_Convert = $Instance_Invite + $ZoneConvert;
- #Loop through the array of Names to invite
- foreach my $FriendName (@FriendNames)
- {
- $FriendName =~ s/^\s+|\s+$//g; #Strip spaces from the beginning or end of the name
- quest::crosszonesignalclientbyname($FriendName, $Instance_Invite_Convert);
- $client->Message(315, " ");
- $client->Message(315, "You sent an invite to $FriendName to join Raid Instance ($Instance_Invite) in $zonesn.");
- # $client->Message(315, "You sent an invite to $FriendName to join instance ($Instance_Invite) in $zonesn.");
- }
- }
- ##########################################################################################################################
- else
- {
- $client->Message(315, " ");
- $client->Message(315, "You do not have (or are not leader of) a Raid Instance for inviting.");
- }
- $qglobals{"$RaidInstanceID"} = undef;
- }
- # REMOVE Guild Member
- if($text=~/^Guild Remove /i && $text ne "Guild Remove")
- {
- my $GuildID = $uguild_id;
- my $GuildInstanceID = "GuildI_" . "$GuildID" . "_$zonesn" . "_$zoneid";
- if (GET_QGLOBAL_VALUE("$GuildInstanceID"))
- {
- my $GetFriendName = substr($text, 13);
- my $Instance_Remove = 0 + GET_QGLOBAL_VALUE("$GuildInstanceID");
- my $Instance_Remove2 = $Instance_Remove + 1000000000 + ($zoneid * 1000000); # 1,000,000,000
- quest::crosszonesignalclientbyname($GetFriendName, $Instance_Remove2);
- $client->Message(315, " ");
- $client->Message(315, "You removed $GetFriendName from Guild Instance ($Instance_Remove) in $zonesn.");
- }
- else
- {
- $client->Message(315, " ");
- $client->Message(315, "You do not have a Guild Instance for removing.");
- }
- $qglobals{"$GuildInstanceID"} = undef;
- }
- # REMOVE Raid Member
- if($text=~/^Raid Remove /i && $text ne "Raid Remove")
- {
- my $RaidID = $name;
- my $RaidInstanceID = "$RaidID" . "_RaidI_" . "$zonesn" . "_" . "$zoneid";
- if (GET_QGLOBAL_VALUE("$RaidInstanceID"))
- {
- my $GetFriendName = substr($text, 12);
- my $Instance_Remove = 0 + GET_QGLOBAL_VALUE("$RaidInstanceID");
- my $Instance_Remove2 = $Instance_Remove + 1000000000 + ($zoneid * 1000000); # 1,000,000,000
- quest::crosszonesignalclientbyname($GetFriendName, $Instance_Remove2);
- $client->Message(315, " ");
- $client->Message(315, "You removed $GetFriendName from Raid Instance ($Instance_Remove) in $zonesn.");
- }
- else
- {
- $client->Message(315, " ");
- $client->Message(315, "You do not have (or are not leader of) a Raid Instance for removing.");
- }
- $qglobals{"$RaidInstanceID"} = undef;
- }
- if($text=~/^guild join$/i)
- {
- $client->Message(315, " ");
- $client->Message(315,"Syntax: guild join <Player Name>");
- }
- if($text=~/^raid join$/i)
- {
- $client->Message(315, " ");
- $client->Message(315,"Syntax: raid join <Player Name>");
- }
- if($text=~/^guild remove$/i)
- {
- $client->Message(315, " ");
- $client->Message(315,"Syntax: guild remove <Player Name>");
- }
- if($text=~/^raid remove$/i)
- {
- $client->Message(315, " ");
- $client->Message(315,"Syntax: raid remove <Player Name>");
- }
- ###############################################################################################
- ### JOIN GUILD INSTANCE #######################################################################
- if($text=~/^guild join /i)
- {
- my $Check_G_Leader = substr($text, 11);
- my $Check_G_Invite = "_GuildI_" . $zonesn . "_" . "$zoneid";
- my $GetGuildInstanceGlobal = $Check_G_Leader . "_GuildI_" . $zonesn . "_" . $zoneid;
- my $GetJoinID = 0;
- if (GET_QGLOBAL_VALUE("$GetGuildInstanceGlobal"))
- {
- $GetJoinID = GET_QGLOBAL_VALUE("$GetGuildInstanceGlobal");
- $Check_G_Invite = $GetJoinID . $Check_G_Invite;
- }
- if (GET_QGLOBAL_VALUE("$Check_G_Invite"))
- {
- # Find Player Qglobal to change status
- my $count = 1;
- my $guild_invite_name = $GetJoinID . "_GuildI_Status_";
- my $guild_invite_pending = $name . "_pending";
- my $guild_invite_joined = $name . "_joined";
- my $guild_invite_removed = $name . "_removed";
- my $compare_name = "";
- my $Leader = $Check_G_Leader;
- while ($count > 0)
- {
- if (GET_QGLOBAL_VALUE("$guild_invite_name$count"))
- {
- $compare_name = GET_QGLOBAL_VALUE("$guild_invite_name$count");
- if ($compare_name eq $guild_invite_pending || $compare_name eq $guild_invite_joined)
- {
- # When pending or joined qglobal name found, change value from pending to joined, then enter.
- my $GetSeconds = GET_TIME_LEFT("GUILD", $GetJoinID);
- quest::setglobal("$guild_invite_name$count","$guild_invite_joined","7","S$GetSeconds");
- my $timestamp = localtime(time);
- my $Cx = $client->GetX();
- my $Cy = $client->GetY();
- my $Cz = $client->GetZ();
- quest::popup("ENTERING INVITED GUILD INSTANCE","<br>
- <c \"#FE2E2E\">Moving you to a INVITED Guild Instance ($GetJoinID)!<br>
- <br>
- <c \"#FFFF49\">Time : <c \"#00FF00\">$timestamp<br>
- <c \"#FFFF49\">Name : <c \"#00FF00\">$name<br>
- <c \"#FFFF49\">Zone : <c \"#00FF00\">$zonesn<br>
- <c \"#FFFF49\">Type : <c \"#00FF00\">$Leader Guild Instance<br>
- <br>
- <c \"#00BFFF\">ENJOY!<br>
- <br>
- ",1050,0);
- $client->Message(315, " ");
- $client->Message(315, "Moving you to $Leader Guild Instance ($GetJoinID) for $zonesn.");
- $qglobals{"$guild_invite_name"} = undef;
- quest::AssignToInstance($GetJoinID);
- quest::MovePCInstance($zoneid, $GetJoinID, $Cx, $Cy, $Cz);
- $count = 0;
- }
- elsif ($compare_name eq $guild_invite_removed)
- {
- $client->Message(315, " ");
- $client->Message(315, "You were BANNED from $Leader Guild Instance ($GetJoinID) for $zonesn.");
- $count = 0;
- }
- else
- {
- $count ++;
- }
- }
- else
- {
- $client->Message(315,"You were not invited to $Leader Guild Instance $GetJoinID in $zonesn!");
- $count = 0;
- }
- }
- }
- else
- {
- $client->Message(315,"Guild Instance $Check_G_Leader in $zonesn does not exist!");
- }
- $qglobals{"$Check_G_Invite"} = undef;
- $qglobals{"$Check_G_Leader"} = undef;
- }
- ### END JOIN GUILD INSTANCE ##################################################################
- ###############################################################################################
- ###############################################################################################
- ### JOIN RAID INSTANCE ########################################################################
- ### $name_Raid_$zonesn_$zoneid, XXX_RaidI_Leader, XXX__RaidI_Time, XXX_RaidI_$zonesn_$zoneid, XXX_RaidI_Status_YYY
- if($text=~/^raid join /i)
- {
- my $Check_R_Leader = substr($text, 10);
- my $Check_R_Invite = "_RaidI_" . $zonesn . "_" . "$zoneid";
- my $GetRaidInstanceGlobal = $Check_R_Leader . "_RaidI_" . $zonesn . "_" . $zoneid;
- my $GetJoinID = 0;
- if (GET_QGLOBAL_VALUE("$GetRaidInstanceGlobal"))
- {
- $GetJoinID = GET_QGLOBAL_VALUE("$GetRaidInstanceGlobal");
- $Check_R_Invite = $GetJoinID . $Check_R_Invite;
- }
- if (GET_QGLOBAL_VALUE("$Check_R_Invite"))
- {
- # Find Player Qglobal to change status
- my $count = 1;
- my $raid_invite_name = $GetJoinID . "_RaidI_Status_";
- my $raid_invite_pending = $name . "_pending";
- my $raid_invite_joined = $name . "_joined";
- my $raid_invite_removed = $name . "_removed";
- my $compare_name = "";
- my $Leader = $Check_R_Leader;
- while ($count > 0)
- {
- if (GET_QGLOBAL_VALUE("$raid_invite_name$count"))
- {
- $compare_name = GET_QGLOBAL_VALUE("$raid_invite_name$count");
- if ($compare_name eq $raid_invite_pending || $compare_name eq $raid_invite_joined)
- {
- # When qglobal name found, change value from pending to joined, then enter
- my $GetSeconds = GET_TIME_LEFT("RAID", $GetJoinID);
- quest::setglobal("$raid_invite_name$count","$raid_invite_joined","7","S$GetSeconds");
- my $timestamp = localtime(time);
- my $Cx = $client->GetX();
- my $Cy = $client->GetY();
- my $Cz = $client->GetZ();
- quest::popup("ENTERING INVITED RAID INSTANCE","<br>
- <c \"#FE2E2E\">Moving you to a INVITED Raid Instance ($GetJoinID)!<br>
- <br>
- <c \"#FFFF49\">Time : <c \"#00FF00\">$timestamp<br>
- <c \"#FFFF49\">Name : <c \"#00FF00\">$name<br>
- <c \"#FFFF49\">Zone : <c \"#00FF00\">$zonesn<br>
- <c \"#FFFF49\">Type : <c \"#00FF00\">$Leader Raid Instance<br>
- <br>
- <c \"#00BFFF\">ENJOY!<br>
- <br>
- ",1050,0);
- $client->Message(315, " ");
- $client->Message(315, "Moving you to $Leader Raid Instance ($GetJoinID) for $zonesn.");
- $qglobals{"$raid_invite_name"} = undef;
- quest::AssignToInstance($GetJoinID);
- quest::MovePCInstance($zoneid, $GetJoinID, $Cx, $Cy, $Cz);
- $count = 0;
- }
- elsif ($compare_name eq $raid_invite_removed)
- {
- $client->Message(315, " ");
- $client->Message(315, "You were BANNED from $Leader Raid Instance ($GetJoinID) for $zonesn.");
- $count = 0;
- }
- else
- {
- $count ++;
- }
- }
- else
- {
- $client->Message(315,"You were not invited to $Leader Raid Instance $GetJoinID in $zonesn!");
- $count = 0;
- }
- }
- }
- else
- {
- $client->Message(315,"Raid Instance for $Check_R_Leader in $zonesn does not exist!");
- }
- $qglobals{"$Check_R_Invite"} = undef;
- $qglobals{"$Check_R_Leader"} = undef;
- }
- ### END JOIN RAID INSTANCE ###################################################################
- ###############################################################################################
- #################################################################################################################################################
- # LIST of players invited/assigned to Guild Instance
- if($text=~/^Guild List$/i)
- {
- my $timestamp = localtime(time);
- $client->Message(315," ");
- my $GuildID = $uguild_id;
- my $GuildInstanceID = "GuildI_" . "$GuildID" . "_$zonesn" . "_$zoneid";
- if (GET_QGLOBAL_VALUE("$GuildInstanceID"))
- {
- my $Check_G_Invite = GET_QGLOBAL_VALUE("$GuildInstanceID") . "_GuildI_" . $zonesn . "_" . "$zoneid";
- my $Check_G_Leader = GET_QGLOBAL_VALUE("$GuildInstanceID") . "_GuildI_Leader";
- my $GID = GET_QGLOBAL_VALUE("$GuildInstanceID");
- # GET TIME LEFT UNTIL INSTANCE EXPIRES
- my $LeaderTime = $GID . "_GuildI_Time";
- my $ExpireTime = GET_QGLOBAL_VALUE("$LeaderTime");
- my $TimeLeft = $ExpireTime - time();
- my $GetDays = int($TimeLeft/(24*60*60));
- my $GetHours = ($TimeLeft/(60*60))%24;
- my $GetMins = ($TimeLeft/60)%60;
- my $GetSecs = $TimeLeft%60;
- $client->Message(315,"Expires: $GetDays Day, $GetHours Hr, $GetMins Min, $GetSecs Sec");
- $client->Message(315,"List of players in your Guild Instance ($GID) in $zonesn!");
- my $names_list = "";
- my $temp_name = "";
- my $guild_invite_name = $GID . "_GuildI_Status_";
- my $count = 1;
- my $player_count = 0;
- while ($count > 0)
- {
- if (GET_QGLOBAL_VALUE("$guild_invite_name$count"))
- {
- $player_count = $count;
- $temp_name = GET_QGLOBAL_VALUE("$guild_invite_name$count");
- if ($temp_name=~/pending$/i)
- {
- my $player_name = $temp_name;
- $player_name =~ s/_pending//; # string substitute flag
- my $player_status = " - Pending";
- my $yellow = "<c \"#AEB404\">";
- my $white = "<c \"#FFFFFF\">";
- my $player_space = " ";
- my $BR = "<br>";
- my $player_number = "<c \"#0489B1\">$count : "; # Teal Color
- $names_list = $names_list . $player_number . $white . $player_name . $yellow . $player_status . $BR;
- }
- elsif ($temp_name=~/joined$/i)
- {
- my $player_name = $temp_name;
- $player_name =~ s/_joined//;
- my $player_status = " - Joined";
- my $green = "<c \"#298A08\">";
- my $white = "<c \"#FFFFFF\">";
- my $player_space = " ";
- my $BR = "<br>";
- my $player_number = "<c \"#0489B1\">$count : "; # Teal Color
- $names_list = $names_list . $player_number . $white . $player_name . $green . $player_status . $BR;
- }
- elsif ($temp_name=~/removed$/i)
- {
- my $player_name = $temp_name;
- $player_name =~ s/_removed//;
- my $player_status = " - Removed";
- my $red = "<c \"#FE2E2E\">";
- my $white = "<c \"#FFFFFF\">";
- my $player_space = " ";
- my $BR = "<br>";
- my $player_number = "<c \"#0489B1\">$count : "; # Teal Color
- $names_list = $names_list . $player_number . $white . $player_name . $red . $player_status . $BR;
- }
- else
- {
- quest::gmsay("GM: GUILD LIST ADD NAME ERROR.", 18, 0);
- }
- # quest::gmsay("GM: $temp_name added to List", 18, 0);
- $count ++;
- }
- else
- {
- # quest::gmsay("GM: End of List", 18, 0);
- $count = 0;
- }
- }
- quest::popup("GUILD INSTANCE LIST","
- Expires: $GetDays Day, $GetHours Hr, $GetMins Min, $GetSecs Sec <br>
- <c \"#FE2E2E\">List of ($player_count) players in Guild Instance ($GID) in $zonesn<br>
- <br>
- $names_list
- <br>
- ",1050,0);
- $qglobals{"$Check_G_Invite"} = undef;
- $qglobals{"$Check_G_Leader"} = undef;
- }
- else { $client->Message(315,"You do not have a Guild Instance in $zonesn!"); }
- $qglobals{"$GuildInstanceID"} = undef;
- }
- # End Guild Instance LIST
- #################################################################################################################################################
- #################################################################################################################################################
- # List of players invited/assigned to Raid Instance
- if($text=~/^Raid List$/i)
- {
- # my $timestamp = localtime(time);
- $client->Message(315," ");
- # my $RaidID = $name;
- # QGLOBAL NAME LEADER OF RAID CAN SEE
- my $RaidInstanceID = "$name" . "_RaidI_" . "$zonesn" . "_" . "$zoneid";
- # RaidI_Group_7002_nro_34 - QGLOBAL NAME RAID GROUP MEMBER CAN SEE
- my $Check_G_Invite = "NA";
- my $Check_G_Leader = "NA";
- my $GID = 0;
- my $RaidGroup = $client->GetRaid();
- # Get info if part of Raid Group so can do Raid List
- if (defined($RaidGroup))
- {
- my $raidID = $RaidGroup->GetID();
- my $Raid_Group_Global_Name = "RaidI_Group_" . $raidID . "_$zonesn" . "_$zoneid";
- if (GET_QGLOBAL_VALUE($Raid_Group_Global_Name))
- {
- $Check_G_Invite = GET_QGLOBAL_VALUE("$Raid_Group_Global_Name") . "_RaidI_" . $zonesn . "_" . "$zoneid";
- $Check_G_Leader = GET_QGLOBAL_VALUE("$Raid_Group_Global_Name") . "_RaidI_Leader";
- $GID = GET_QGLOBAL_VALUE("$Raid_Group_Global_Name");
- }
- }
- # Else if not in group, is the player the leader of non grouped raid?
- elsif (GET_QGLOBAL_VALUE("$RaidInstanceID"))
- {
- $Check_G_Invite = GET_QGLOBAL_VALUE("$RaidInstanceID") . "_RaidI_" . $zonesn . "_" . "$zoneid";
- $Check_G_Leader = GET_QGLOBAL_VALUE("$RaidInstanceID") . "_RaidI_Leader";
- $GID = GET_QGLOBAL_VALUE("$RaidInstanceID");
- }
- # Else not leader of raid and not member of raid group for current zone name
- else
- {
- # $client->Message(315,"You do not have (or are not leader of) a Raid Instance in $zonesn!"); # This message already used below
- }
- # If raid instance exist for either leader or raid group member in current zone, then do a list
- if ($GID > 0) # If we have a Guild Instance ID from either leader or raid group member, then show list
- {
- # OLD CODE TO JUST ALLOW LEADER OF RAID TO DO A LIST -- DELETE SOON
- # my $Check_G_Invite = GET_QGLOBAL_VALUE("$RaidInstanceID") . "_RaidI_" . $zonesn . "_" . "$zoneid";
- # my $Check_G_Leader = GET_QGLOBAL_VALUE("$RaidInstanceID") . "_RaidI_Leader";
- # my $GID = GET_QGLOBAL_VALUE("$RaidInstanceID");
- # GET TIME LEFT UNTIL INSTANCE EXPIRES
- my $LeaderTime = $GID . "_RaidI_Time";
- my $ExpireTime = GET_QGLOBAL_VALUE("$LeaderTime");
- my $TimeLeft = $ExpireTime - time();
- my $GetDays = int($TimeLeft/(24*60*60));
- my $GetHours = ($TimeLeft/(60*60))%24;
- my $GetMins = ($TimeLeft/60)%60;
- my $GetSecs = $TimeLeft%60;
- $client->Message(315,"Expires: $GetDays Day, $GetHours Hr, $GetMins Min, $GetSecs Sec");
- $client->Message(315,"List of players in your Raid Instance ($GID) in $zonesn!");
- my $names_list = "";
- my $temp_name = "";
- my $raid_invite_name = $GID . "_RaidI_Status_";
- my $count = 1;
- my $player_count = 0;
- while ($count > 0)
- {
- if (GET_QGLOBAL_VALUE("$raid_invite_name$count"))
- {
- $player_count = $count;
- $temp_name = GET_QGLOBAL_VALUE("$raid_invite_name$count");
- if ($temp_name=~/pending$/i)
- {
- my $player_name = $temp_name;
- $player_name =~ s/_pending//; # string substitute flag
- my $player_status = " - Pending";
- my $yellow = "<c \"#AEB404\">";
- my $white = "<c \"#FFFFFF\">";
- my $player_space = " ";
- my $BR = "<br>";
- my $player_number = "<c \"#0489B1\">$count : "; # Teal Color
- $names_list = $names_list . $player_number . $white . $player_name . $yellow . $player_status . $BR;
- }
- elsif ($temp_name=~/joined$/i)
- {
- my $player_name = $temp_name;
- $player_name =~ s/_joined//;
- my $player_status = " - Joined";
- my $green = "<c \"#298A08\">";
- my $white = "<c \"#FFFFFF\">";
- my $player_space = " ";
- my $BR = "<br>";
- my $player_number = "<c \"#0489B1\">$count : "; # Teal Color
- $names_list = $names_list . $player_number . $white . $player_name . $green . $player_status . $BR;
- }
- elsif ($temp_name=~/removed$/i)
- {
- my $player_name = $temp_name;
- $player_name =~ s/_removed//;
- my $player_status = " - Removed";
- my $red = "<c \"#FE2E2E\">";
- my $white = "<c \"#FFFFFF\">";
- my $player_space = " ";
- my $BR = "<br>";
- my $player_number = "<c \"#0489B1\">$count : "; # Teal Color
- $names_list = $names_list . $player_number . $white . $player_name . $red . $player_status . $BR;
- }
- else
- {
- quest::gmsay("GM: RAID LIST ADD NAME ERROR.", 18, 0);
- }
- # quest::gmsay("GM: $temp_name added to List", 18, 0);
- $count ++;
- }
- else
- {
- # quest::gmsay("GM: End of List", 18, 0);
- $count = 0;
- }
- }
- quest::popup("RAID INSTANCE LIST","
- Expires: $GetDays Day, $GetHours Hr, $GetMins Min, $GetSecs Sec <br>
- <c \"#FE2E2E\">List of ($player_count) players in Raid Instance ($GID) in $zonesn<br>
- <br>
- $names_list
- <br>
- ",1050,0);
- $qglobals{"$Check_G_Invite"} = undef;
- $qglobals{"$Check_G_Leader"} = undef;
- }
- else
- {
- $client->Message(315,"You do not have (or are not leader of) a Raid Instance in $zonesn!");
- # $client->Message(315,"GID = $GID");
- }
- $qglobals{"$RaidInstanceID"} = undef;
- }
- # End Raid Instance LIST
- #################################################################################################################################################
- if($text=~/^More Options$/i)
- {
- # $client->Message(315, " ");
- my $GuildInvite = quest::saylink("Guild Invite", 1);
- my $GuildJoin = quest::saylink("Guild Join", 1);
- my $GuildRemove = quest::saylink("Guild Remove", 1);
- my $RaidInvite = quest::saylink("Raid Invite", 1);
- my $RaidJoin = quest::saylink("Raid Join", 1);
- my $RaidRemove = quest::saylink("Raid Remove", 1);
- my $Deposit = quest::saylink("Deposit",1);
- my $Withdraw = quest::saylink("Withdraw",1);
- my $Balance = quest::saylink("Balance",1);
- $client->Message(315, "More Waypoint Options ...");
- $client->Message(315, "[$RaidInvite] [$RaidJoin] [$RaidRemove]");
- $client->Message(315, "[$GuildInvite] [$GuildJoin] [$GuildRemove]");
- $client->Message(315, "[$Balance] [$Deposit] [$Withdraw]");
- }
- if($text =~ /^Balance$/i)
- {
- # plugin::CreditStatusAccount("BankCredit");
- Check_Balance("BankCredit");
- }
- if($text =~ /^Deposit$/i)
- {
- $client->Message(315," ");
- $client->Message(315,"Just give a Waypoint any amount of platinum you'd like to deposit!");
- }
- if($text =~ /^Withdraw$/i)
- {
- $client->Message(315," ");
- $client->Message(315,"Withdraw not available.");
- }
- if($text=~/^Leave Instance$/i)
- {
- my $Cx = $client->GetX();
- my $Cy = $client->GetY();
- my $Cz = $client->GetZ();
- my $Ch = $client->GetHeading();
- my $timestamp = localtime(time);
- $client->Message(315," ");
- $client->Message(315,"Moving you back to public zone in $zonesn!");
- quest::popup("LEAVE INSTANCE","<br>
- <c \"#FE2E2E\">You choose to leave instance.<br>
- <c \"#FE2E2E\">Moving you to a PUBLIC zone!<br>
- <br>
- <c \"#FFFF49\">Time : <c \"#00FF00\">$timestamp<br>
- <c \"#FFFF49\">Name : <c \"#00FF00\">$name<br>
- <c \"#FFFF49\">Zone : <c \"#00FF00\">$zonesn<br>
- <c \"#FFFF49\">Type : <c \"#00FF00\">Public<br>
- <br>
- <c \"#00BFFF\">ENJOY!<br>
- <br>
- ",1050,0);
- quest::movepc($zoneid, $Cx, $Cy, $Cz, $Ch);
- }
- } # End SPAM DELAY
- } # End EVENT_SAY
- sub EVENT_SIGNAL
- {
- quest::gmsay("GM: $signal", 18, 0);
- # 1000000000 is to remove player from Guild and Raid Instances (1,000,000,000)
- my $signal_ID = 0;
- my $signal_zone_ID = 0;
- my $signal_instance_ID = 0;
- if ($signal > 1000000000)
- {
- $signal_ID = $signal - 1000000000; # If remove player from instance flag, use signal - 1 BILLION
- }
- else
- {
- $signal_ID = $signal; # else no remove flag, just use signal
- }
- $signal_zone_ID = int ($signal_ID / 1000000); # Before signal sent, was: $ZoneConvert = $zoneid * 1000000;
- $signal_instance_ID = int ($signal_ID % 1000000);
- my $zone_name = GET_ZONE_NAME_BY_ID($signal_zone_ID);
- my $Check_G_Invite = $signal_instance_ID . "_GuildI_" . $zone_name . "_" . "$signal_zone_ID";
- my $Check_G_Leader = $signal_instance_ID . "_GuildI_Leader";
- my $Check_R_Invite = $signal_instance_ID . "_RaidI_" . $zone_name . "_" . "$signal_zone_ID";
- my $Check_R_Leader = $signal_instance_ID . "_RaidI_Leader";
- #############################################################################################################################
- # IF GUILD INVITE ###########################################################################################################
- if (GET_QGLOBAL_VALUE("$Check_G_Invite"))
- {
- my $Leader = GET_QGLOBAL_VALUE("$Check_G_Leader");
- quest::AssignToInstance($signal_instance_ID);
- # Create a qglobal list of players invited/assigned to Guild Instance
- my $count = 1;
- my $guild_invite_name = $signal_instance_ID . "_GuildI_Status_";
- my $guild_invite_pending = $name . "_pending";
- my $guild_invite_joined = $name . "_joined";
- my $guild_invite_removed = $name . "_removed";
- while ($count > 0)
- {
- if (GET_QGLOBAL_VALUE("$guild_invite_name$count"))
- {
- if (GET_QGLOBAL_VALUE("$guild_invite_name$count") eq $guild_invite_pending ||
- GET_QGLOBAL_VALUE("$guild_invite_name$count") eq $guild_invite_joined)
- {
- if ($signal > 1000000000)
- {
- my $Cx = $client->GetX();
- my $Cy = $client->GetY();
- my $Cz = $client->GetZ();
- my $Ch = $client->GetHeading();
- my $timestamp = localtime(time);
- $client->Message(315," ");
- $client->Message(315,"You have been removed from $Leader Guild Instance ($signal_instance_ID) in $zone_name!");
- quest::popup("YOU HAVE BEEN REMOVED","<br>
- <c \"#FE2E2E\">You have been removed from $Leader Guild Instance.<br>
- <c \"#FE2E2E\">Moving you to a PUBLIC zone!<br>
- <br>
- <c \"#FFFF49\">Time : <c \"#00FF00\">$timestamp<br>
- <c \"#FFFF49\">Name : <c \"#00FF00\">$name<br>
- <c \"#FFFF49\">Zone : <c \"#00FF00\">$zone_name<br>
- <c \"#FFFF49\">Type : <c \"#00FF00\">Public<br>
- <br>
- <c \"#00BFFF\">You have been removed from Guild Instance ($signal_instance_ID) in $zone_name!<br>
- <br>
- ",1050,0);
- my $GetSeconds = GET_TIME_LEFT("GUILD", $signal_instance_ID);
- quest::setglobal("$guild_invite_name$count","$guild_invite_removed","7","S$GetSeconds");
- $count = 0;
- if ($signal_zone_ID == $zoneid)
- {
- $client->Message(315,"Zoning you out of $zonesn.");
- quest::movepc($zoneid, $Cx, $Cy, $Cz, $Ch); # If current zone = same name for instance, then move to public
- }
- else
- {
- $client->Message(315,"You have already zoned out of $zone_name.");
- }
- }
- else
- {
- my $GetSeconds = GET_TIME_LEFT("GUILD", $signal_instance_ID);
- my $correct_zone = GET_ZONE_NAME_BY_ID($signal_zone_ID);
- quest::setglobal("$guild_invite_name$count","$guild_invite_pending","7","S$GetSeconds");
- $client->Message(315," ");
- $client->Message(315,"$Leader has re-invited you to join a Guild Instance in $correct_zone.");
- $client->Message(315,"Type: guild join $Leader (when you are in $correct_zone)");
- }
- $count = 0;
- }
- elsif (GET_QGLOBAL_VALUE("$guild_invite_name$count") eq $guild_invite_removed)
- {
- if ($signal < 1000000000)
- {
- my $GetSeconds = GET_TIME_LEFT("GUILD", $signal_instance_ID);
- my $correct_zone = GET_ZONE_NAME_BY_ID($signal_zone_ID);
- quest::setglobal("$guild_invite_name$count","$guild_invite_pending","7","S$GetSeconds");
- $client->Message(315," ");
- $client->Message(315,"$Leader has re-invited you to join a Guild Instance in $correct_zone.");
- $client->Message(315,"Type: guild join $Leader (when you are in $correct_zone)");
- }
- $count = 0;
- }
- else
- {
- $count ++;
- }
- }
- else
- {
- ###############################################################################
- my $GetSeconds = GET_TIME_LEFT("GUILD", $signal_instance_ID);
- my $correct_zone = GET_ZONE_NAME_BY_ID($signal_zone_ID);
- quest::setglobal("$guild_invite_name$count","$guild_invite_pending","7","S$GetSeconds");
- $client->Message(315," ");
- $client->Message(315,"$Leader has invited you to join a Guild Instance in $correct_zone.");
- $client->Message(315,"Type: guild join $Leader (when you are in $correct_zone)");
- $count = 0;
- }
- }
- $qglobals{"$Check_G_Invite"} = undef;
- $qglobals{"$Check_G_Leader"} = undef;
- }
- # END IF GUILD INVITE #######################################################################################################
- #############################################################################################################################
- #############################################################################################################################
- # IF RAID INVITE ############################################################################################################
- if (GET_QGLOBAL_VALUE("$Check_R_Invite"))
- {
- my $Leader = GET_QGLOBAL_VALUE("$Check_R_Leader");
- quest::AssignToInstance($signal_instance_ID);
- # Create a qglobal list of players invited/assigned to Raid Instance
- my $count = 1;
- my $raid_invite_name = $signal_instance_ID . "_RaidI_Status_";
- my $raid_invite_pending = $name . "_pending";
- my $raid_invite_joined = $name . "_joined";
- my $raid_invite_removed = $name . "_removed";
- while ($count > 0)
- {
- if (GET_QGLOBAL_VALUE("$raid_invite_name$count"))
- {
- if (GET_QGLOBAL_VALUE("$raid_invite_name$count") eq $raid_invite_pending ||
- GET_QGLOBAL_VALUE("$raid_invite_name$count") eq $raid_invite_joined)
- {
- if ($signal > 1000000000)
- {
- my $Cx = $client->GetX();
- my $Cy = $client->GetY();
- my $Cz = $client->GetZ();
- my $Ch = $client->GetHeading();
- my $timestamp = localtime(time);
- $client->Message(315," ");
- $client->Message(315,"You have been removed from $Leader Raid Instance ($signal_instance_ID) in $zone_name!");
- quest::popup("YOU HAVE BEEN REMOVED","<br>
- <c \"#FE2E2E\">You have been removed from $Leader Raid Instance.<br>
- <c \"#FE2E2E\">Moving you to a PUBLIC zone!<br>
- <br>
- <c \"#FFFF49\">Time : <c \"#00FF00\">$timestamp<br>
- <c \"#FFFF49\">Name : <c \"#00FF00\">$name<br>
- <c \"#FFFF49\">Zone : <c \"#00FF00\">$zone_name<br>
- <c \"#FFFF49\">Type : <c \"#00FF00\">Public<br>
- <br>
- <c \"#00BFFF\">You have been removed from Raid Instance ($signal_instance_ID) in $zone_name!<br>
- <br>
- ",1050,0);
- my $GetSeconds = GET_TIME_LEFT("RAID", $signal_instance_ID);
- quest::setglobal("$raid_invite_name$count","$raid_invite_removed","7","S$GetSeconds");
- $count = 0;
- if ($signal_zone_ID == $zoneid)
- {
- $client->Message(315,"Zoning you out of $zonesn.");
- quest::movepc($zoneid, $Cx, $Cy, $Cz, $Ch); # If current zone = same name for instance, then move to public
- }
- else
- {
- $client->Message(315,"You have already zoned out of $zone_name.");
- }
- }
- else
- {
- my $GetSeconds = GET_TIME_LEFT("RAID", $signal_instance_ID);
- my $correct_zone = GET_ZONE_NAME_BY_ID($signal_zone_ID);
- quest::setglobal("$raid_invite_name$count","$raid_invite_pending","7","S$GetSeconds");
- $client->Message(315," ");
- $client->Message(315,"$Leader has re-invited you to join a Raid Instance in $zone_name.");
- $client->Message(315,"Type: raid join $Leader (when you are in $correct_zone)");
- }
- $count = 0;
- }
- elsif (GET_QGLOBAL_VALUE("$raid_invite_name$count") eq $raid_invite_removed)
- {
- if ($signal < 1000000000)
- {
- my $GetSeconds = GET_TIME_LEFT("RAID", $signal_instance_ID);
- my $correct_zone = GET_ZONE_NAME_BY_ID($signal_zone_ID);
- quest::setglobal("$raid_invite_name$count","$raid_invite_pending","7","S$GetSeconds");
- $client->Message(315," ");
- $client->Message(315,"$Leader has re-invited you to join a Raid Instance in $zone_name.");
- $client->Message(315,"Type: raid join $Leader (when you are in $correct_zone)");
- }
- $count = 0;
- }
- else
- {
- $count ++;
- }
- }
- else
- {
- ###############################################################################
- my $GetSeconds = GET_TIME_LEFT("RAID", $signal_instance_ID);
- my $correct_zone = GET_ZONE_NAME_BY_ID($signal_zone_ID);
- quest::setglobal("$raid_invite_name$count","$raid_invite_pending","7","S$GetSeconds");
- $client->Message(315," ");
- $client->Message(315,"$Leader has invited you to join a Raid Instance in $zone_name.");
- $client->Message(315,"Type: raid join $Leader (when you are in $correct_zone)");
- $count = 0;
- }
- }
- $qglobals{"$Check_R_Invite"} = undef;
- $qglobals{"$Check_R_Leader"} = undef;
- }
- # END IF RAID INVITE ########################################################################################################
- #############################################################################################################################
- } # End EVENT_SIGNAL
- #################################################################################################################################
- #### CUSTOM SUBS ############################################################################################################
- #################################################################################################################################
- ### Usage: PayInstance("Creditname", Cost, "Solo/Guild/Raid");
- ### This will take into account the whole account of the player
- sub PayInstance
- {
- my $CreditName = $_[0];
- my $Cost = $_[1];
- my $Instance_Type = $_[2]; # Solo, Guild, or Raid
- my $client = plugin::val('$client');
- my $name = plugin::val('$name');
- my $zonesn = plugin::val('$zonesn');
- my $qglobals = plugin::var('qglobals');
- my $space = "_";
- my $accountid = $client->AccountID();
- my $accountname = $client->AccountName();
- # my $CreditAmnt = GET_QGLOBAL_VALUE("$CreditName$space$accountid");
- my $CreditAmnt = GET_QGLOBAL_VALUE("$CreditName$space$accountid");
- my $CreditAmnt2 = commify2($CreditAmnt - $Cost);
- my $CostCommify = commify2($Cost);
- if ($CreditAmnt < $Cost)
- {
- $client->Message(315,"Insuffient funds... You need " . ($Cost - $CreditAmnt) . " more Platinum pieces.");
- }
- else
- {
- $CreditAmnt -= $Cost;
- $client->SetGlobal("$CreditName$space$accountid", "$CreditAmnt", 7, 'F');
- $client->Message(315," ");
- $client->Message(315,"You now have $CreditAmnt2 platinum left.");
- my $ClientCheck = PlayerClientCheck();
- my $timestamp = localtime(time);
- quest::popup("Account Balance","
- <c \"#FFFF66\">Time : </c> $timestamp </c> <br>
- <c \"#FFFF66\">Client : </c> $ClientCheck </c> <br>
- <c \"#FFFF66\">Account : </c> $accountname <br>
- <c \"#FFFF66\">Character : </c>$name <br>
- <c \"#FFFF66\">Zone Name : </c>$zonesn <br>
- <c \"#FFFF66\">Instance Type : </c>$Instance_Type <br>
- <c \"#FFFF66\">Cost from Account : </c> <c \"#FE2E2E</c> - $CostCommify </c> <br>
- <c \"#FFFF66\">Remaining Balance : </c> <c \"#33FF99\"> $CreditAmnt2 </c> <br>
- <br>
- <c \"#FE2E2E\">WARNING: </c> Like other <c \"#FFFF66\">Qglobals</c>, sometimes the zone will bug out
- and not see the current values. If your balance or instance has disappeared, try going to a public zone
- or different zone to see if it gets refresh.
- We apologize for the inconvenience as it will reappear in time.
- ");
- }
- $qglobals{"$CreditName$space$accountid"} = undef;
- } # End PayInstance
- ### POP UP TO DISPLAY WAYPOINT BALANCE
- sub Check_Balance
- {
- my $CreditName = $_[0];
- my $client = plugin::val('$client');
- my $name = plugin::val('$name');
- my $zonesn = plugin::val('$zonesn');
- my $qglobals = plugin::var('qglobals');
- my $space = "_";
- my $accountid = $client->AccountID();
- my $accountname = $client->AccountName();
- # my $CreditAmnt = GET_QGLOBAL_VALUE("$CreditName$space$accountid");
- my $CreditAmnt = GET_QGLOBAL_VALUE("$CreditName$space$accountid");
- my $CreditAmnt2 = commify2($CreditAmnt);
- # my $CreditAmnt2 = $CreditAmnt - $Cost;
- my $ClientCheck = PlayerClientCheck();
- my $timestamp = localtime(time);
- quest::popup("Account Balance","
- <c \"#FFFF66\">Time : </c> $timestamp </c> <br>
- <c \"#FFFF66\">Client : </c> $ClientCheck </c> <br>
- <c \"#FFFF66\">Account : </c> $accountname <br>
- <c \"#FFFF66\">Character : </c>$name <br>
- <c \"#FFFF66\">Zone Name : </c>$zonesn <br>
- <c \"#FFFF66\">Remaining Balance : </c> <c \"#33FF99\"> $CreditAmnt2 </c> <br>
- <br>
- <c \"#FE2E2E\">WARNING: </c> Like other <c \"#FFFF66\">Qglobals</c> , sometimes the zone will bug out
- and not see the current values. If your balance or instance has disappeared, try going to a public zone
- or different zone to see if it gets refresh.
- We apologize for the inconvenience as it will reappear in time.
- ");
- $client->Message(315," ");
- $client->Message(315,"You now have $CreditAmnt2 platinum left.");
- $qglobals{"$CreditName$space$accountid"} = undef;
- } # End Check_Balance
- ### Check Expansion Name
- sub PlayerClientCheck
- {
- my $client = plugin::val('$client');
- my $clientver = $client->GetClientVersion();
- my $ShowClient = "";
- if ($clientver == 2) { $ShowClient = "Titanium"; }
- elsif ($clientver == 3) { $ShowClient = "Secrets of Faydwer"; }
- elsif ($clientver == 4) { $ShowClient = "Seeds of Destruction"; }
- elsif ($clientver == 5) { $ShowClient = "Underfoot"; }
- else { $ShowClient = "Other"; }
- return "$ShowClient";
- }
- ### Change 1000000 to 1,000,000
- sub commify2
- {
- local $_ = shift;
- s{(?<!\d|\.)(\d{4,})}
- {my $n = $1;
- $n=~s/(?<=.)(?=(?:.{3})+$)/,/g;
- $n;
- }eg;
- return $_;
- }
- sub SOLO_PRICE
- {
- my $client = plugin::val('$client');
- my $freeinstance = plugin::check_hasitem($client, 120003); #EDIT item ID for FREE instance item
- my $paidinstance = plugin::check_hasitem($client, 119998); #EDIT item ID for PAID instance item
- my $new_price = 1000;
- if ($freeinstance) { $new_price = 0; }
- elsif ($paidinstance) {
- # $new_price = 1000;
- if ($zonesn eq "trakanon" ||
- $zonesn eq "permafrost" ||
- $zonesn eq "dalnir" ||
- $zonesn eq "velketor" ||
- $zonesn eq "eastkarana" ||
- $zonesn eq "highpasshold" ||
- $zonesn eq "highpass" ||
- $zonesn eq "unrest" ||
- $zonesn eq "crushbone" ||
- $zonesn eq "sebilis" ||
- $zonesn eq "lakerathe" ||
- $zonesn eq "soldungb" ||
- $zonesn eq "citymist" ||
- $zonesn eq "qeytoqrg" ||
- $zonesn eq "mistmoore" ||
- $zonesn eq "steamfont" ||
- $zonesn eq "gukbottom" ||
- $zonesn eq "oot" ||
- $zonesn eq "najena" ||
- $zonesn eq "befallen")
- { $new_price = 5000; }
- if ($zonesn eq "postorms") { $new_price = 25000; }
- if ($zonesn eq "hohonora") { $new_price = 50000; }
- if ($zonesn eq "illsalin") { $new_price = 75000; }
- if ($zonesn eq "anguish") { $new_price = 100000; }
- if ($zonesn eq "lopingplains") { $new_price = 125000; }
- if ($zonesn eq "frozenshadow") { $new_price = 999999999; }
- }
- else { $new_price = 50000000; } # 50 Million Plat for not having a 1 Million Plat Waypoint Clickie
- $new_price = 0; # FREE WHILE TESTING!
- # DISABLED ZONES
- if ($zonesn eq "overthere") { $new_price = 999999999; } # Due to Custom PvP Area
- if ($zonesn eq "commons") { $new_price = 999999999; } # Due to Custom PvP Area
- return $new_price;
- }
- sub GUILD_PRICE
- {
- my $freeinstance = plugin::check_hasitem($client, 120003); #EDIT item ID for FREE instance item
- my $paidinstance = plugin::check_hasitem($client, 119998); #EDIT item ID for PAID instance item
- my $new_price = 5000;
- if ($freeinstance) { $new_price = 0; }
- elsif ($paidinstance) {
- # $new_price = 3000;
- if ($zonesn eq "trakanon" ||
- $zonesn eq "permafrost" ||
- $zonesn eq "dalnir" ||
- $zonesn eq "velketor" ||
- $zonesn eq "eastkarana" ||
- $zonesn eq "highpasshold" ||
- $zonesn eq "highpass" ||
- $zonesn eq "unrest" ||
- $zonesn eq "crushbone" ||
- $zonesn eq "sebilis" ||
- $zonesn eq "lakerathe" ||
- $zonesn eq "soldungb" ||
- $zonesn eq "citymist" ||
- $zonesn eq "qeytoqrg" ||
- $zonesn eq "mistmoore" ||
- $zonesn eq "steamfont" ||
- $zonesn eq "gukbottom" ||
- $zonesn eq "oot" ||
- $zonesn eq "najena" ||
- $zonesn eq "befallen")
- { $new_price = 10000; }
- if ($zonesn eq "postorms") { $new_price = 50000; }
- if ($zonesn eq "hohonora") { $new_price = 75000; }
- if ($zonesn eq "illsalin") { $new_price = 250000; }
- if ($zonesn eq "anguish") { $new_price = 350000; }
- if ($zonesn eq "lopingplains") { $new_price = 500000; }
- if ($zonesn eq "frozenshadow") { $new_price = 999999999; }
- }
- else { $new_price = 50000000; } # 50 Million Plat for not having a 1 Million Plat Waypoint Clickie
- $new_price = 0; # FREE WHILE TESTING!
- # DISABLED ZONES
- if ($zonesn eq "overthere") { $new_price = 999999999; } # Due to Custom PvP Area
- if ($zonesn eq "commons") { $new_price = 999999999; } # Due to Custom PvP Area
- return $new_price;
- }
- sub RAID_PRICE
- {
- my $freeinstance = plugin::check_hasitem($client, 120003); #EDIT item ID for FREE instance item
- my $paidinstance = plugin::check_hasitem($client, 119998); #EDIT item ID for PAID instance item
- my $new_price = 5000;
- if ($freeinstance) { $new_price = 0; }
- elsif ($paidinstance) {
- # $new_price = 5000;
- if ($zonesn eq "trakanon" ||
- $zonesn eq "permafrost" ||
- $zonesn eq "dalnir" ||
- $zonesn eq "velketor" ||
- $zonesn eq "eastkarana" ||
- $zonesn eq "highpasshold" ||
- $zonesn eq "highpass" ||
- $zonesn eq "unrest" ||
- $zonesn eq "crushbone" ||
- $zonesn eq "sebilis" ||
- $zonesn eq "lakerathe" ||
- $zonesn eq "soldungb" ||
- $zonesn eq "citymist" ||
- $zonesn eq "qeytoqrg" ||
- $zonesn eq "mistmoore" ||
- $zonesn eq "steamfont" ||
- $zonesn eq "gukbottom" ||
- $zonesn eq "oot" ||
- $zonesn eq "najena" ||
- $zonesn eq "befallen")
- { $new_price = 10000; }
- if ($zonesn eq "postorms") { $new_price = 50000; }
- if ($zonesn eq "hohonora") { $new_price = 75000; }
- if ($zonesn eq "illsalin") { $new_price = 250000; }
- if ($zonesn eq "anguish") { $new_price = 350000; }
- if ($zonesn eq "lopingplains") { $new_price = 500000; }
- if ($zonesn eq "frozenshadow") { $new_price = 999999999; }
- }
- else { $new_price = 50000000; } # 50 Million Plat for not having a 1 Million Plat Waypoint Clickie
- $new_price = 0; # FREE WHILE TESTING!
- # DISABLED ZONES
- if ($zonesn eq "overthere") { $new_price = 999999999; } # Due to Custom PvP Area
- if ($zonesn eq "commons") { $new_price = 999999999; } # Due to Custom PvP Area
- return $new_price;
- }
- ### Gets the amount of time left for the instance so we can sync/set qglobal expire times
- ### for invited player (on list) qglobal and leader created instance qglobal to expire at same time
- sub GET_TIME_LEFT
- {
- my $instance_type = $_[0]; # IS IT "GUILD" OR "RAID" TYPE?
- my $InstID = $_[1]; # ID OF INSTANCE
- my $TimeName = "";
- my $qglobals = plugin::var('qglobals');
- my $LeaderTime = "";
- my $ExpireTime = 0;
- my $TimeLeft = 0;
- if ($instance_type eq "RAID") { $TimeName = "_RaidI_Time"; }
- if ($instance_type eq "GUILD") { $TimeName = "_GuildI_Time"; }
- $LeaderTime = $InstID . $TimeName;
- if (GET_QGLOBAL_VALUE("$LeaderTime"))
- {
- $ExpireTime = GET_QGLOBAL_VALUE("$LeaderTime");
- $TimeLeft = $ExpireTime - time();
- }
- return $TimeLeft
- }
- sub GET_ZONE_NAME_BY_ID
- {
- if ($_[0] == 0) { return("Invalid Zone"); }
- elsif ($_[0] == 1) { return("qeynos"); }
- elsif ($_[0] == 2) { return("qeynos2"); }
- elsif ($_[0] == 3) { return("qrg"); }
- elsif ($_[0] == 4) { return("qeytoqrg"); }
- elsif ($_[0] == 5) { return("highpass"); }
- elsif ($_[0] == 6) { return("highkeep"); }
- elsif ($_[0] == 8) { return("freportn"); }
- elsif ($_[0] == 9) { return("freportw"); }
- elsif ($_[0] == 10) { return("freporte"); }
- elsif ($_[0] == 11) { return("runnyeye"); }
- elsif ($_[0] == 12) { return("qey2hh1"); }
- elsif ($_[0] == 13) { return("northkarana"); }
- elsif ($_[0] == 14) { return("southkarana"); }
- elsif ($_[0] == 15) { return("eastkarana"); }
- elsif ($_[0] == 16) { return("beholder"); }
- elsif ($_[0] == 17) { return("blackburrow"); }
- elsif ($_[0] == 18) { return("paw"); }
- elsif ($_[0] == 19) { return("rivervale"); }
- elsif ($_[0] == 20) { return("kithicor"); }
- elsif ($_[0] == 21) { return("commons"); }
- elsif ($_[0] == 22) { return("ecommons"); }
- elsif ($_[0] == 23) { return("erudnint"); }
- elsif ($_[0] == 24) { return("erudnext"); }
- elsif ($_[0] == 25) { return("nektulos"); }
- elsif ($_[0] == 25) { return("nektulos"); }
- elsif ($_[0] == 26) { return("cshome"); }
- elsif ($_[0] == 27) { return("lavastorm"); }
- elsif ($_[0] == 28) { return("nektropos"); }
- elsif ($_[0] == 29) { return("halas"); }
- elsif ($_[0] == 30) { return("everfrost"); }
- elsif ($_[0] == 31) { return("soldunga"); }
- elsif ($_[0] == 32) { return("soldungb"); }
- elsif ($_[0] == 33) { return("misty"); }
- elsif ($_[0] == 34) { return("nro"); }
- elsif ($_[0] == 35) { return("sro"); }
- elsif ($_[0] == 36) { return("befallen"); }
- elsif ($_[0] == 37) { return("oasis"); }
- elsif ($_[0] == 38) { return("tox"); }
- elsif ($_[0] == 39) { return("hole"); }
- elsif ($_[0] == 40) { return("neriaka"); }
- elsif ($_[0] == 41) { return("neriakb"); }
- elsif ($_[0] == 42) { return("neriakc"); }
- elsif ($_[0] == 43) { return("neriakd"); }
- elsif ($_[0] == 44) { return("najena"); }
- elsif ($_[0] == 45) { return("qcat"); }
- elsif ($_[0] == 46) { return("innothule"); }
- elsif ($_[0] == 47) { return("feerrott"); }
- elsif ($_[0] == 48) { return("cazicthule"); }
- elsif ($_[0] == 49) { return("oggok"); }
- elsif ($_[0] == 50) { return("rathemtn"); }
- elsif ($_[0] == 51) { return("lakerathe"); }
- elsif ($_[0] == 52) { return("grobb"); }
- elsif ($_[0] == 53) { return("aviak"); }
- elsif ($_[0] == 54) { return("gfaydark"); }
- elsif ($_[0] == 55) { return("akanon"); }
- elsif ($_[0] == 56) { return("steamfont"); }
- elsif ($_[0] == 57) { return("lfaydark"); }
- elsif ($_[0] == 58) { return("crushbone"); }
- elsif ($_[0] == 59) { return("mistmoore"); }
- elsif ($_[0] == 60) { return("kaladima"); }
- elsif ($_[0] == 61) { return("felwithea"); }
- elsif ($_[0] == 62) { return("felwitheb"); }
- elsif ($_[0] == 63) { return("unrest"); }
- elsif ($_[0] == 64) { return("kedge"); }
- elsif ($_[0] == 65) { return("guktop"); }
- elsif ($_[0] == 66) { return("gukbottom"); }
- elsif ($_[0] == 67) { return("kaladimb"); }
- elsif ($_[0] == 68) { return("butcher"); }
- elsif ($_[0] == 69) { return("oot"); }
- elsif ($_[0] == 70) { return("cauldron"); }
- elsif ($_[0] == 71) { return("airplane"); }
- elsif ($_[0] == 72) { return("fearplane"); }
- elsif ($_[0] == 73) { return("permafrost"); }
- elsif ($_[0] == 74) { return("kerraridge"); }
- elsif ($_[0] == 75) { return("paineel"); }
- elsif ($_[0] == 76) { return("hateplane"); }
- elsif ($_[0] == 77) { return("arena"); }
- elsif ($_[0] == 78) { return("fieldofbone"); }
- elsif ($_[0] == 79) { return("warslikswood"); }
- elsif ($_[0] == 80) { return("soltemple"); }
- elsif ($_[0] == 81) { return("droga"); }
- elsif ($_[0] == 82) { return("cabwest"); }
- elsif ($_[0] == 83) { return("swampofnohope"); }
- elsif ($_[0] == 84) { return("firiona"); }
- elsif ($_[0] == 85) { return("lakeofillomen"); }
- elsif ($_[0] == 86) { return("dreadlands"); }
- elsif ($_[0] == 87) { return("burningwood"); }
- elsif ($_[0] == 88) { return("kaesora"); }
- elsif ($_[0] == 89) { return("sebilis"); }
- elsif ($_[0] == 90) { return("citymist"); }
- elsif ($_[0] == 91) { return("skyfire"); }
- elsif ($_[0] == 92) { return("frontiermtns"); }
- elsif ($_[0] == 93) { return("overthere"); }
- elsif ($_[0] == 94) { return("emeraldjungle"); }
- elsif ($_[0] == 95) { return("trakanon"); }
- elsif ($_[0] == 96) { return("timorous"); }
- elsif ($_[0] == 97) { return("kurn"); }
- elsif ($_[0] == 98) { return("erudsxing"); }
- elsif ($_[0] == 100) { return("stonebrunt"); }
- elsif ($_[0] == 101) { return("warrens"); }
- elsif ($_[0] == 102) { return("karnor"); }
- elsif ($_[0] == 103) { return("chardok"); }
- elsif ($_[0] == 104) { return("dalnir"); }
- elsif ($_[0] == 105) { return("charasis"); }
- elsif ($_[0] == 106) { return("cabeast"); }
- elsif ($_[0] == 107) { return("nurga"); }
- elsif ($_[0] == 108) { return("veeshan"); }
- elsif ($_[0] == 109) { return("veksar"); }
- elsif ($_[0] == 110) { return("iceclad"); }
- elsif ($_[0] == 111) { return("frozenshadow"); }
- elsif ($_[0] == 112) { return("velketor"); }
- elsif ($_[0] == 113) { return("kael"); }
- elsif ($_[0] == 114) { return("skyshrine"); }
- elsif ($_[0] == 114) { return("skyshrine"); }
- elsif ($_[0] == 115) { return("thurgadina"); }
- elsif ($_[0] == 116) { return("eastwastes"); }
- elsif ($_[0] == 117) { return("cobaltscar"); }
- elsif ($_[0] == 118) { return("greatdivide"); }
- elsif ($_[0] == 119) { return("wakening"); }
- elsif ($_[0] == 120) { return("westwastes"); }
- elsif ($_[0] == 121) { return("crystal"); }
- elsif ($_[0] == 123) { return("necropolis"); }
- elsif ($_[0] == 124) { return("templeveeshan"); }
- elsif ($_[0] == 125) { return("sirens"); }
- elsif ($_[0] == 126) { return("mischiefplane"); }
- elsif ($_[0] == 127) { return("growthplane"); }
- elsif ($_[0] == 128) { return("sleeper"); }
- elsif ($_[0] == 129) { return("thurgadinb"); }
- elsif ($_[0] == 130) { return("erudsxing2"); }
- elsif ($_[0] == 150) { return("shadowhaven"); }
- elsif ($_[0] == 151) { return("bazaar"); }
- elsif ($_[0] == 151) { return("bazaar"); }
- elsif ($_[0] == 152) { return("nexus"); }
- elsif ($_[0] == 153) { return("echo"); }
- elsif ($_[0] == 154) { return("acrylia"); }
- elsif ($_[0] == 155) { return("sharvahl"); }
- elsif ($_[0] == 156) { return("paludal"); }
- elsif ($_[0] == 157) { return("fungusgrove"); }
- elsif ($_[0] == 158) { return("vexthal"); }
- elsif ($_[0] == 159) { return("sseru"); }
- elsif ($_[0] == 160) { return("katta"); }
- elsif ($_[0] == 161) { return("netherbian"); }
- elsif ($_[0] == 162) { return("ssratemple"); }
- elsif ($_[0] == 163) { return("griegsend"); }
- elsif ($_[0] == 164) { return("thedeep"); }
- elsif ($_[0] == 165) { return("shadeweaver"); }
- elsif ($_[0] == 166) { return("hollowshade"); }
- elsif ($_[0] == 167) { return("grimling"); }
- elsif ($_[0] == 168) { return("mseru"); }
- elsif ($_[0] == 169) { return("letalis"); }
- elsif ($_[0] == 170) { return("twilight"); }
- elsif ($_[0] == 171) { return("thegrey"); }
- elsif ($_[0] == 172) { return("tenebrous"); }
- elsif ($_[0] == 173) { return("maiden"); }
- elsif ($_[0] == 174) { return("dawnshroud"); }
- elsif ($_[0] == 175) { return("scarlet"); }
- elsif ($_[0] == 176) { return("umbral"); }
- elsif ($_[0] == 179) { return("akheva"); }
- elsif ($_[0] == 180) { return("arena2"); }
- elsif ($_[0] == 181) { return("jaggedpine"); }
- elsif ($_[0] == 182) { return("nedaria"); }
- elsif ($_[0] == 183) { return("tutorial"); }
- elsif ($_[0] == 184) { return("load"); }
- elsif ($_[0] == 185) { return("load2"); }
- elsif ($_[0] == 186) { return("hateplaneb"); }
- elsif ($_[0] == 187) { return("shadowrest"); }
- elsif ($_[0] == 188) { return("tutoriala"); }
- elsif ($_[0] == 189) { return("tutorialb"); }
- elsif ($_[0] == 190) { return("clz"); }
- elsif ($_[0] == 200) { return("codecay"); }
- elsif ($_[0] == 201) { return("pojustice"); }
- elsif ($_[0] == 202) { return("poknowledge"); }
- elsif ($_[0] == 203) { return("potranquility"); }
- elsif ($_[0] == 204) { return("ponightmare"); }
- elsif ($_[0] == 205) { return("podisease"); }
- elsif ($_[0] == 206) { return("poinnovation"); }
- elsif ($_[0] == 207) { return("potorment"); }
- elsif ($_[0] == 208) { return("povalor"); }
- elsif ($_[0] == 209) { return("bothunder"); }
- elsif ($_[0] == 210) { return("postorms"); }
- elsif ($_[0] == 211) { return("hohonora"); }
- elsif ($_[0] == 212) { return("solrotower"); }
- elsif ($_[0] == 213) { return("powar"); }
- elsif ($_[0] == 214) { return("potactics"); }
- elsif ($_[0] == 215) { return("poair"); }
- elsif ($_[0] == 216) { return("powater"); }
- elsif ($_[0] == 217) { return("pofire"); }
- elsif ($_[0] == 218) { return("poeartha"); }
- elsif ($_[0] == 219) { return("potimea"); }
- elsif ($_[0] == 220) { return("hohonorb"); }
- elsif ($_[0] == 221) { return("nightmareb"); }
- elsif ($_[0] == 222) { return("poearthb"); }
- elsif ($_[0] == 223) { return("potimeb"); }
- elsif ($_[0] == 224) { return("gunthak"); }
- elsif ($_[0] == 225) { return("dulak"); }
- elsif ($_[0] == 226) { return("torgiran"); }
- elsif ($_[0] == 227) { return("nadox"); }
- elsif ($_[0] == 228) { return("hatesfury"); }
- elsif ($_[0] == 229) { return("guka"); }
- elsif ($_[0] == 230) { return("ruja"); }
- elsif ($_[0] == 231) { return("taka"); }
- elsif ($_[0] == 232) { return("mira"); }
- elsif ($_[0] == 233) { return("mmca"); }
- elsif ($_[0] == 234) { return("gukb"); }
- elsif ($_[0] == 235) { return("rujb"); }
- elsif ($_[0] == 236) { return("takb"); }
- elsif ($_[0] == 237) { return("mirb"); }
- elsif ($_[0] == 238) { return("mmcb"); }
- elsif ($_[0] == 239) { return("gukc"); }
- elsif ($_[0] == 240) { return("rujc"); }
- elsif ($_[0] == 241) { return("takc"); }
- elsif ($_[0] == 242) { return("mirc"); }
- elsif ($_[0] == 243) { return("mmcc"); }
- elsif ($_[0] == 244) { return("gukd"); }
- elsif ($_[0] == 245) { return("rujd"); }
- elsif ($_[0] == 246) { return("takd"); }
- elsif ($_[0] == 247) { return("mird"); }
- elsif ($_[0] == 248) { return("mmcd"); }
- elsif ($_[0] == 249) { return("guke"); }
- elsif ($_[0] == 250) { return("ruje"); }
- elsif ($_[0] == 251) { return("take"); }
- elsif ($_[0] == 252) { return("mire"); }
- elsif ($_[0] == 253) { return("mmce"); }
- elsif ($_[0] == 254) { return("gukf"); }
- elsif ($_[0] == 255) { return("rujf"); }
- elsif ($_[0] == 256) { return("takf"); }
- elsif ($_[0] == 257) { return("mirf"); }
- elsif ($_[0] == 258) { return("mmcf"); }
- elsif ($_[0] == 259) { return("gukg"); }
- elsif ($_[0] == 260) { return("rujg"); }
- elsif ($_[0] == 261) { return("takg"); }
- elsif ($_[0] == 262) { return("mirg"); }
- elsif ($_[0] == 263) { return("mmcg"); }
- elsif ($_[0] == 264) { return("gukh"); }
- elsif ($_[0] == 265) { return("rujh"); }
- elsif ($_[0] == 266) { return("takh"); }
- elsif ($_[0] == 267) { return("mirh"); }
- elsif ($_[0] == 268) { return("mmch"); }
- elsif ($_[0] == 269) { return("ruji"); }
- elsif ($_[0] == 270) { return("taki"); }
- elsif ($_[0] == 271) { return("miri"); }
- elsif ($_[0] == 272) { return("mmci"); }
- elsif ($_[0] == 273) { return("rujj"); }
- elsif ($_[0] == 274) { return("takj"); }
- elsif ($_[0] == 275) { return("mirj"); }
- elsif ($_[0] == 276) { return("mmcj"); }
- elsif ($_[0] == 277) { return("chardokb"); }
- elsif ($_[0] == 278) { return("soldungc"); }
- elsif ($_[0] == 279) { return("abysmal"); }
- elsif ($_[0] == 280) { return("natimbi"); }
- elsif ($_[0] == 281) { return("qinimi"); }
- elsif ($_[0] == 282) { return("riwwi"); }
- elsif ($_[0] == 283) { return("barindu"); }
- elsif ($_[0] == 284) { return("ferubi"); }
- elsif ($_[0] == 285) { return("snpool"); }
- elsif ($_[0] == 286) { return("snlair"); }
- elsif ($_[0] == 287) { return("snplant"); }
- elsif ($_[0] == 288) { return("sncrematory"); }
- elsif ($_[0] == 289) { return("tipt"); }
- elsif ($_[0] == 290) { return("vxed"); }
- elsif ($_[0] == 291) { return("yxtta"); }
- elsif ($_[0] == 292) { return("uqua"); }
- elsif ($_[0] == 293) { return("kodtaz"); }
- elsif ($_[0] == 294) { return("ikkinz"); }
- elsif ($_[0] == 295) { return("qvic"); }
- elsif ($_[0] == 296) { return("inktuta"); }
- elsif ($_[0] == 297) { return("txevu"); }
- elsif ($_[0] == 298) { return("tacvi"); }
- elsif ($_[0] == 299) { return("qvicb"); }
- elsif ($_[0] == 300) { return("wallofslaughter"); }
- elsif ($_[0] == 301) { return("bloodfields"); }
- elsif ($_[0] == 302) { return("draniksscar"); }
- elsif ($_[0] == 303) { return("causeway"); }
- elsif ($_[0] == 304) { return("chambersa"); }
- elsif ($_[0] == 305) { return("chambersb"); }
- elsif ($_[0] == 306) { return("chambersc"); }
- elsif ($_[0] == 307) { return("chambersd"); }
- elsif ($_[0] == 308) { return("chamberse"); }
- elsif ($_[0] == 309) { return("chambersf"); }
- elsif ($_[0] == 316) { return("provinggrounds"); }
- elsif ($_[0] == 317) { return("anguish"); }
- elsif ($_[0] == 318) { return("dranikhollowsa"); }
- elsif ($_[0] == 319) { return("dranikhollowsb"); }
- elsif ($_[0] == 320) { return("dranikhollowsc"); }
- elsif ($_[0] == 328) { return("dranikcatacombsa"); }
- elsif ($_[0] == 329) { return("dranikcatacombsb"); }
- elsif ($_[0] == 330) { return("dranikcatacombsc"); }
- elsif ($_[0] == 331) { return("draniksewersa"); }
- elsif ($_[0] == 332) { return("draniksewersb"); }
- elsif ($_[0] == 333) { return("draniksewersc"); }
- elsif ($_[0] == 334) { return("riftseekers"); }
- elsif ($_[0] == 335) { return("harbingers"); }
- elsif ($_[0] == 336) { return("dranik"); }
- elsif ($_[0] == 337) { return("broodlands"); }
- elsif ($_[0] == 338) { return("stillmoona"); }
- elsif ($_[0] == 339) { return("stillmoonb"); }
- elsif ($_[0] == 340) { return("thundercrest"); }
- elsif ($_[0] == 341) { return("delvea"); }
- elsif ($_[0] == 342) { return("delveb"); }
- elsif ($_[0] == 343) { return("thenest"); }
- elsif ($_[0] == 344) { return("guildlobby"); }
- elsif ($_[0] == 345) { return("guildhall"); }
- elsif ($_[0] == 346) { return("barter"); }
- elsif ($_[0] == 347) { return("illsalin"); }
- elsif ($_[0] == 348) { return("illsalina"); }
- elsif ($_[0] == 349) { return("illsalinb"); }
- elsif ($_[0] == 350) { return("illsalinc"); }
- elsif ($_[0] == 351) { return("dreadspire"); }
- elsif ($_[0] == 354) { return("drachnidhive"); }
- elsif ($_[0] == 355) { return("drachnidhivea"); }
- elsif ($_[0] == 356) { return("drachnidhiveb"); }
- elsif ($_[0] == 357) { return("drachnidhivec"); }
- elsif ($_[0] == 358) { return("westkorlach"); }
- elsif ($_[0] == 359) { return("westkorlacha"); }
- elsif ($_[0] == 360) { return("westkorlachb"); }
- elsif ($_[0] == 361) { return("westkorlachc"); }
- elsif ($_[0] == 362) { return("eastkorlach"); }
- elsif ($_[0] == 363) { return("eastkorlacha"); }
- elsif ($_[0] == 364) { return("shadowspine"); }
- elsif ($_[0] == 365) { return("corathus"); }
- elsif ($_[0] == 366) { return("corathusa"); }
- elsif ($_[0] == 367) { return("corathusb"); }
- elsif ($_[0] == 368) { return("nektulosa"); }
- elsif ($_[0] == 369) { return("arcstone"); }
- elsif ($_[0] == 370) { return("relic"); }
- elsif ($_[0] == 371) { return("skylance"); }
- elsif ($_[0] == 372) { return("devastation"); }
- elsif ($_[0] == 373) { return("devastationa"); }
- elsif ($_[0] == 374) { return("rage"); }
- elsif ($_[0] == 375) { return("ragea"); }
- elsif ($_[0] == 376) { return("takishruins"); }
- elsif ($_[0] == 377) { return("takishruinsa"); }
- elsif ($_[0] == 378) { return("elddar"); }
- elsif ($_[0] == 379) { return("elddara"); }
- elsif ($_[0] == 380) { return("theater"); }
- elsif ($_[0] == 381) { return("theatera"); }
- elsif ($_[0] == 382) { return("freeporteast"); }
- elsif ($_[0] == 383) { return("freeportwest"); }
- elsif ($_[0] == 384) { return("freeportsewers"); }
- elsif ($_[0] == 385) { return("freeportacademy"); }
- elsif ($_[0] == 386) { return("freeporttemple"); }
- elsif ($_[0] == 387) { return("freeportmilitia"); }
- elsif ($_[0] == 388) { return("freeportarena"); }
- elsif ($_[0] == 389) { return("freeportcityhall"); }
- elsif ($_[0] == 390) { return("freeporttheater"); }
- elsif ($_[0] == 391) { return("freeporthall"); }
- elsif ($_[0] == 392) { return("northro"); }
- elsif ($_[0] == 393) { return("southro"); }
- elsif ($_[0] == 394) { return("crescent"); }
- elsif ($_[0] == 395) { return("moors"); }
- elsif ($_[0] == 396) { return("stonehive"); }
- elsif ($_[0] == 397) { return("mesa"); }
- elsif ($_[0] == 398) { return("roost"); }
- elsif ($_[0] == 399) { return("steppes"); }
- elsif ($_[0] == 400) { return("icefall"); }
- elsif ($_[0] == 401) { return("valdeholm"); }
- elsif ($_[0] == 402) { return("frostcrypt"); }
- elsif ($_[0] == 403) { return("sunderock"); }
- elsif ($_[0] == 404) { return("vergalid"); }
- elsif ($_[0] == 405) { return("direwind"); }
- elsif ($_[0] == 406) { return("ashengate"); }
- elsif ($_[0] == 407) { return("highpasshold"); }
- elsif ($_[0] == 408) { return("commonlands"); }
- elsif ($_[0] == 409) { return("oceanoftears"); }
- elsif ($_[0] == 410) { return("kithforest"); }
- elsif ($_[0] == 411) { return("befallenb"); }
- elsif ($_[0] == 412) { return("highpasskeep"); }
- elsif ($_[0] == 413) { return("innothuleb"); }
- elsif ($_[0] == 414) { return("toxxulia"); }
- elsif ($_[0] == 415) { return("mistythicket"); }
- elsif ($_[0] == 416) { return("kattacastrum"); }
- elsif ($_[0] == 417) { return("thalassius"); }
- elsif ($_[0] == 418) { return("atiiki"); }
- elsif ($_[0] == 419) { return("zhisza"); }
- elsif ($_[0] == 420) { return("silyssar"); }
- elsif ($_[0] == 421) { return("solteris"); }
- elsif ($_[0] == 422) { return("barren"); }
- elsif ($_[0] == 423) { return("buriedsea"); }
- elsif ($_[0] == 424) { return("jardelshook"); }
- elsif ($_[0] == 425) { return("monkeyrock"); }
- elsif ($_[0] == 426) { return("suncrest"); }
- elsif ($_[0] == 427) { return("deadbone"); }
- elsif ($_[0] == 428) { return("blacksail"); }
- elsif ($_[0] == 429) { return("maidensgrave"); }
- elsif ($_[0] == 430) { return("redfeather"); }
- elsif ($_[0] == 431) { return("shipmvp"); }
- elsif ($_[0] == 432) { return("shipmvu"); }
- elsif ($_[0] == 433) { return("shippvu"); }
- elsif ($_[0] == 434) { return("shipuvu"); }
- elsif ($_[0] == 435) { return("shipmvm"); }
- elsif ($_[0] == 436) { return("mechanotus"); }
- elsif ($_[0] == 437) { return("mansion"); }
- elsif ($_[0] == 438) { return("steamfactory"); }
- elsif ($_[0] == 439) { return("shipworkshop"); }
- elsif ($_[0] == 440) { return("gyrospireb"); }
- elsif ($_[0] == 441) { return("gyrospirez"); }
- elsif ($_[0] == 442) { return("dragonscale"); }
- elsif ($_[0] == 443) { return("lopingplains"); }
- elsif ($_[0] == 444) { return("hillsofshade"); }
- elsif ($_[0] == 445) { return("bloodmoon"); }
- elsif ($_[0] == 446) { return("crystallos"); }
- elsif ($_[0] == 447) { return("guardian"); }
- elsif ($_[0] == 448) { return("steamfontmts"); }
- elsif ($_[0] == 449) { return("cryptofshade"); }
- elsif ($_[0] == 451) { return("dragonscaleb"); }
- elsif ($_[0] == 452) { return("oldfieldofbone"); }
- elsif ($_[0] == 453) { return("oldkaesoraa"); }
- elsif ($_[0] == 454) { return("oldkaesorab"); }
- elsif ($_[0] == 455) { return("oldkurn"); }
- elsif ($_[0] == 456) { return("oldkithicor"); }
- elsif ($_[0] == 457) { return("oldcommons"); }
- elsif ($_[0] == 458) { return("oldhighpass"); }
- elsif ($_[0] == 459) { return("thevoida"); }
- elsif ($_[0] == 460) { return("thevoidb"); }
- elsif ($_[0] == 461) { return("thevoidc"); }
- elsif ($_[0] == 462) { return("thevoidd"); }
- elsif ($_[0] == 463) { return("thevoide"); }
- elsif ($_[0] == 464) { return("thevoidf"); }
- elsif ($_[0] == 465) { return("thevoidg"); }
- elsif ($_[0] == 466) { return("oceangreenhills"); }
- elsif ($_[0] == 467) { return("oceangreenvillage"); }
- elsif ($_[0] == 468) { return("oldblackburrow"); }
- elsif ($_[0] == 469) { return("bertoxtemple"); }
- elsif ($_[0] == 470) { return("discord"); }
- elsif ($_[0] == 471) { return("discordtower"); }
- elsif ($_[0] == 472) { return("oldbloodfield"); }
- elsif ($_[0] == 473) { return("precipiceofwar"); }
- elsif ($_[0] == 474) { return("olddranik"); }
- elsif ($_[0] == 475) { return("toskirakk"); }
- elsif ($_[0] == 476) { return("korascian"); }
- elsif ($_[0] == 477) { return("rathechamber"); }
- elsif ($_[0] == 480) { return("brellsrest"); }
- elsif ($_[0] == 481) { return("fungalforest"); }
- elsif ($_[0] == 482) { return("underquarry"); }
- elsif ($_[0] == 483) { return("coolingchamber"); }
- elsif ($_[0] == 484) { return("shiningcity"); }
- elsif ($_[0] == 485) { return("arthicrex"); }
- elsif ($_[0] == 486) { return("foundation"); }
- elsif ($_[0] == 487) { return("lichencreep"); }
- elsif ($_[0] == 488) { return("pellucid"); }
- elsif ($_[0] == 489) { return("stonesnake"); }
- elsif ($_[0] == 490) { return("brellstemple"); }
- elsif ($_[0] == 491) { return("convorteum"); }
- elsif ($_[0] == 492) { return("brellsarena"); }
- elsif ($_[0] == 493) { return("weddingchapel"); }
- elsif ($_[0] == 494) { return("weddingchapeldark"); }
- elsif ($_[0] == 495) { return("dragoncrypt"); }
- elsif ($_[0] == 700) { return("feerrott2"); }
- elsif ($_[0] == 701) { return("thulehouse1"); }
- elsif ($_[0] == 702) { return("thulehouse2"); }
- elsif ($_[0] == 703) { return("housegarden"); }
- elsif ($_[0] == 704) { return("thulelibrary"); }
- elsif ($_[0] == 705) { return("well"); }
- elsif ($_[0] == 706) { return("fallen"); }
- elsif ($_[0] == 707) { return("morellcastle"); }
- elsif ($_[0] == 708) { return("somnium"); }
- elsif ($_[0] == 709) { return("alkabormare"); }
- elsif ($_[0] == 710) { return("miragulmare"); }
- elsif ($_[0] == 711) { return("thuledream"); }
- elsif ($_[0] == 712) { return("neighborhood"); }
- elsif ($_[0] == 724) { return("argath"); }
- elsif ($_[0] == 725) { return("arelis"); }
- elsif ($_[0] == 726) { return("sarithcity"); }
- elsif ($_[0] == 727) { return("rubak"); }
- elsif ($_[0] == 728) { return("beastdomain"); }
- elsif ($_[0] == 729) { return("resplendent"); }
- elsif ($_[0] == 730) { return("pillarsalra"); }
- elsif ($_[0] == 731) { return("windsong"); }
- elsif ($_[0] == 732) { return("cityofbronze"); }
- elsif ($_[0] == 733) { return("sepulcher"); }
- elsif ($_[0] == 734) { return("eastsepulcher"); }
- elsif ($_[0] == 735) { return("westsepulcher"); }
- elsif ($_[0] == 996) { return("arttest"); }
- elsif ($_[0] == 998) { return("fhalls"); }
- elsif ($_[0] == 999) { return("apprentice"); }
- else { return("ELSE ERROR ZONE ID TO NAME"); }
- } # End GET_ZONE_NAME_BY_ID()
- ### Copy from Akkadius Plugin
- sub ListZoneSNToID2
- {
- my $ZoneSN = $_[0];
- my $text = plugin::val('$text');
- %ZoneList = (
- "qeynos" => 1,
- "qeynos2" => 2,
- "qrg" => 3,
- "qeytoqrg" => 4,
- "highpass" => 5,
- "highkeep" => 6,
- "freportn" => 8,
- "freportw" => 9,
- "freporte" => 10,
- "runnyeye" => 11,
- "qey2hh1" => 12,
- "northkarana" => 13,
- "southkarana" => 14,
- "eastkarana" => 15,
- "beholder" => 16,
- "blackburrow" => 17,
- "paw" => 18,
- "rivervale" => 19,
- "kithicor" => 20,
- "commons" => 21,
- "ecommons" => 22,
- "erudnint" => 23,
- "erudnext" => 24,
- "nektulos" => 25,
- "cshome" => 26,
- "lavastorm" => 27,
- "nektropos" => 28,
- "halas" => 29,
- "everfrost" => 30,
- "soldunga" => 31,
- "soldungb" => 32,
- "misty" => 33,
- "nro" => 34,
- "sro" => 35,
- "befallen" => 36,
- "oasis" => 37,
- "tox" => 38,
- "hole" => 39,
- "neriaka" => 40,
- "neriakb" => 41,
- "neriakc" => 42,
- "neriakd" => 43,
- "najena" => 44,
- "qcat" => 45,
- "innothule" => 46,
- "feerrott" => 47,
- "cazicthule" => 48,
- "oggok" => 49,
- "rathemtn" => 50,
- "lakerathe" => 51,
- "grobb" => 52,
- "aviak" => 53,
- "gfaydark" => 54,
- "akanon" => 55,
- "steamfont" => 56,
- "lfaydark" => 57,
- "crushbone" => 58,
- "mistmoore" => 59,
- "kaladima" => 60,
- "felwithea" => 61,
- "felwitheb" => 62,
- "unrest" => 63,
- "kedge" => 64,
- "guktop" => 65,
- "gukbottom" => 66,
- "kaladimb" => 67,
- "butcher" => 68,
- "oot" => 69,
- "cauldron" => 70,
- "airplane" => 71,
- "fearplane" => 72,
- "permafrost" => 73,
- "kerraridge" => 74,
- "paineel" => 75,
- "hateplane" => 76,
- "arena" => 77,
- "fieldofbone" => 78,
- "warslikswood" => 79,
- "soltemple" => 80,
- "droga" => 81,
- "cabwest" => 82,
- "swampofnohope" => 83,
- "firiona" => 84,
- "lakeofillomen" => 85,
- "dreadlands" => 86,
- "burningwood" => 87,
- "kaesora" => 88,
- "sebilis" => 89,
- "citymist" => 90,
- "skyfire" => 91,
- "frontiermtns" => 92,
- "overthere" => 93,
- "emeraldjungle" => 94,
- "trakanon" => 95,
- "timorous" => 96,
- "kurn" => 97,
- "erudsxing" => 98,
- "stonebrunt" => 100,
- "warrens" => 101,
- "karnor" => 102,
- "chardok" => 103,
- "dalnir" => 104,
- "charasis" => 105,
- "cabeast" => 106,
- "nurga" => 107,
- "veeshan" => 108,
- "veksar" => 109,
- "iceclad" => 110,
- "frozenshadow" => 111,
- "velketor" => 112,
- "kael" => 113,
- "skyshrine" => 114,
- "thurgadina" => 115,
- "eastwastes" => 116,
- "cobaltscar" => 117,
- "greatdivide" => 118,
- "wakening" => 119,
- "westwastes" => 120,
- "crystal" => 121,
- "necropolis" => 123,
- "templeveeshan" => 124,
- "sirens" => 125,
- "mischiefplane" => 126,
- "growthplane" => 127,
- "sleeper" => 128,
- "thurgadinb" => 129,
- "erudsxing2" => 130,
- "shadowhaven" => 150,
- "bazaar" => 151,
- "nexus" => 152,
- "echo" => 153,
- "acrylia" => 154,
- "sharvahl" => 155,
- "paludal" => 156,
- "fungusgrove" => 157,
- "vexthal" => 158,
- "sseru" => 159,
- "katta" => 160,
- "netherbian" => 161,
- "ssratemple" => 162,
- "griegsend" => 163,
- "thedeep" => 164,
- "shadeweaver" => 165,
- "hollowshade" => 166,
- "grimling" => 167,
- "mseru" => 168,
- "letalis" => 169,
- "twilight" => 170,
- "thegrey" => 171,
- "tenebrous" => 172,
- "maiden" => 173,
- "dawnshroud" => 174,
- "scarlet" => 175,
- "umbral" => 176,
- "akheva" => 179,
- "arena2" => 180,
- "jaggedpine" => 181,
- "nedaria" => 182,
- "tutorial" => 183,
- "load" => 184,
- "load2" => 185,
- "hateplaneb" => 186,
- "shadowrest" => 187,
- "tutoriala" => 188,
- "tutorialb" => 189,
- "clz" => 190,
- "codecay" => 200,
- "pojustice" => 201,
- "poknowledge" => 202,
- "potranquility" => 203,
- "ponightmare" => 204,
- "podisease" => 205,
- "poinnovation" => 206,
- "potorment" => 207,
- "povalor" => 208,
- "bothunder" => 209,
- "postorms" => 210,
- "hohonora" => 211,
- "solrotower" => 212,
- "powar" => 213,
- "potactics" => 214,
- "poair" => 215,
- "powater" => 216,
- "pofire" => 217,
- "poeartha" => 218,
- "potimea" => 219,
- "hohonorb" => 220,
- "nightmareb" => 221,
- "poearthb" => 222,
- "potimeb" => 223,
- "gunthak" => 224,
- "dulak" => 225,
- "torgiran" => 226,
- "nadox" => 227,
- "hatesfury" => 228,
- "guka" => 229,
- "ruja" => 230,
- "taka" => 231,
- "mira" => 232,
- "mmca" => 233,
- "gukb" => 234,
- "rujb" => 235,
- "takb" => 236,
- "mirb" => 237,
- "mmcb" => 238,
- "gukc" => 239,
- "rujc" => 240,
- "takc" => 241,
- "mirc" => 242,
- "mmcc" => 243,
- "gukd" => 244,
- "rujd" => 245,
- "takd" => 246,
- "mird" => 247,
- "mmcd" => 248,
- "guke" => 249,
- "ruje" => 250,
- "take" => 251,
- "mire" => 252,
- "mmce" => 253,
- "gukf" => 254,
- "rujf" => 255,
- "takf" => 256,
- "mirf" => 257,
- "mmcf" => 258,
- "gukg" => 259,
- "rujg" => 260,
- "takg" => 261,
- "mirg" => 262,
- "mmcg" => 263,
- "gukh" => 264,
- "rujh" => 265,
- "takh" => 266,
- "mirh" => 267,
- "mmch" => 268,
- "ruji" => 269,
- "taki" => 270,
- "miri" => 271,
- "mmci" => 272,
- "rujj" => 273,
- "takj" => 274,
- "mirj" => 275,
- "mmcj" => 276,
- "chardokb" => 277,
- "soldungc" => 278,
- "abysmal" => 279,
- "natimbi" => 280,
- "qinimi" => 281,
- "riwwi" => 282,
- "barindu" => 283,
- "ferubi" => 284,
- "snpool" => 285,
- "snlair" => 286,
- "snplant" => 287,
- "sncrematory" => 288,
- "tipt" => 289,
- "vxed" => 290,
- "yxtta" => 291,
- "uqua" => 292,
- "kodtaz" => 293,
- "ikkinz" => 294,
- "qvic" => 295,
- "inktuta" => 296,
- "txevu" => 297,
- "tacvi" => 298,
- "qvicb" => 299,
- "wallofslaughter" => 300,
- "bloodfields" => 301,
- "draniksscar" => 302,
- "causeway" => 303,
- "chambersa" => 304,
- "chambersb" => 305,
- "chambersc" => 306,
- "chambersd" => 307,
- "chamberse" => 308,
- "chambersf" => 309,
- "provinggrounds" => 316,
- "anguish" => 317,
- "dranikhollowsa" => 318,
- "dranikhollowsb" => 319,
- "dranikhollowsc" => 320,
- "dranikhollowsd" => 321,
- "dranikhollowse" => 322,
- "dranikhollowsf" => 323,
- "dranikhollowsg" => 324,
- "dranikhollowsh" => 325,
- "dranikhollowsi" => 326,
- "dranikhollowsj" => 327,
- "dranikcatacombsa" => 328,
- "dranikcatacombsb" => 329,
- "dranikcatacombsc" => 330,
- "draniksewersa" => 331,
- "draniksewersb" => 332,
- "draniksewersc" => 333,
- "riftseekers" => 334,
- "harbingers" => 335,
- "dranik" => 336,
- "broodlands" => 337,
- "stillmoona" => 338,
- "stillmoonb" => 339,
- "thundercrest" => 340,
- "delvea" => 341,
- "delveb" => 342,
- "thenest" => 343,
- "guildlobby" => 344,
- "guildhall" => 345,
- "barter" => 346,
- "illsalin" => 347,
- "illsalina" => 348,
- "illsalinb" => 349,
- "illsalinc" => 350,
- "dreadspire" => 351,
- "drachnidhive" => 354,
- "drachnidhivea" => 355,
- "drachnidhiveb" => 356,
- "drachnidhivec" => 357,
- "westkorlach" => 358,
- "westkorlacha" => 359,
- "westkorlachb" => 360,
- "westkorlachc" => 361,
- "eastkorlach" => 362,
- "eastkorlacha" => 363,
- "shadowspine" => 364,
- "corathus" => 365,
- "corathusa" => 366,
- "corathusb" => 367,
- "nektulosa" => 368,
- "arcstone" => 369,
- "relic" => 370,
- "skylance" => 371,
- "devastation" => 372,
- "devastationa" => 373,
- "rage" => 374,
- "ragea" => 375,
- "takishruins" => 376,
- "takishruinsa" => 377,
- "elddar" => 378,
- "elddara" => 379,
- "theater" => 380,
- "theatera" => 381,
- "freeporteast" => 382,
- "freeportwest" => 383,
- "freeportsewers" => 384,
- "freeportacademy" => 385,
- "freeporttemple" => 386,
- "freeportmilitia" => 387,
- "freeportarena" => 388,
- "freeportcityhall" => 389,
- "freeporttheater" => 390,
- "freeporthall" => 391,
- "northro" => 392,
- "southro" => 393,
- "crescent" => 394,
- "moors" => 395,
- "stonehive" => 396,
- "mesa" => 397,
- "roost" => 398,
- "steppes" => 399,
- "icefall" => 400,
- "valdeholm" => 401,
- "frostcrypt" => 402,
- "sunderock" => 403,
- "vergalid" => 404,
- "direwind" => 405,
- "ashengate" => 406,
- "highpasshold" => 407,
- "commonlands" => 408,
- "oceanoftears" => 409,
- "kithforest" => 410,
- "befallenb" => 411,
- "highpasskeep" => 412,
- "innothuleb" => 413,
- "toxxulia" => 414,
- "mistythicket" => 415,
- "kattacastrum" => 416,
- "thalassius" => 417,
- "atiiki" => 418,
- "zhisza" => 419,
- "silyssar" => 420,
- "solteris" => 421,
- "barren" => 422,
- "buriedsea" => 423,
- "jardelshook" => 424,
- "monkeyrock" => 425,
- "suncrest" => 426,
- "deadbone" => 427,
- "blacksail" => 428,
- "maidensgrave" => 429,
- "redfeather" => 430,
- "shipmvp" => 431,
- "shipmvu" => 432,
- "shippvu" => 433,
- "shipuvu" => 434,
- "shipmvm" => 435,
- "mechanotus" => 436,
- "mansion" => 437,
- "steamfactory" => 438,
- "shipworkshop" => 439,
- "gyrospireb" => 440,
- "gyrospirez" => 441,
- "dragonscale" => 442,
- "lopingplains" => 443,
- "hillsofshade" => 444,
- "bloodmoon" => 445,
- "crystallos" => 446,
- "guardian" => 447,
- "steamfontmts" => 448,
- "cryptofshade" => 449,
- "dragonscaleb" => 451,
- "oldfieldofbone" => 452,
- "oldkaesoraa" => 453,
- "oldkaesorab" => 454,
- "oldkurn" => 455,
- "oldkithicor" => 456,
- "oldcommons" => 457,
- "oldhighpass" => 458,
- "thevoida" => 459,
- "thevoidb" => 460,
- "thevoidc" => 461,
- "thevoidd" => 462,
- "thevoide" => 463,
- "thevoidf" => 464,
- "thevoidg" => 465,
- "oceangreenhills" => 466,
- "oceangreenvillag" => 467,
- "oldblackburrow" => 468,
- "bertoxtemple" => 469,
- "discord" => 470,
- "discordtower" => 471,
- "oldbloodfield" => 472,
- "precipiceofwar" => 473,
- "olddranik" => 474,
- "toskirakk" => 475,
- "korascian" => 476,
- "rathechamber" => 477,
- "arttest" => 996,
- "fhalls" => 998,
- "apprentice" => 999,
- );
- $ZoneList{$ZoneSN};
- } # End ListZoneSNToID2
- ### Establish a Connection with password from Config File
- sub LoadMySQLConnection
- {
- use DBI;
- use DBD::mysql;
- # GET DB, USER, AND PASS FROM CONFIG FILE
- my $confile = "eqemu_config.xml"; #default config file
- open(F, "<$confile") or die "Unable to open config: $confile\n";
- my $indb = 0;
- while(<F>)
- {
- s/\r//g;
- if(/<database>/i) { $indb = 1; }
- next unless($indb == 1);
- if(/<\/database>/i) { $indb = 0; last; }
- if(/<host>(.*)<\/host>/i) { $host = $1; }
- elsif(/<username>(.*)<\/username>/i) { $user = $1; }
- elsif(/<password>(.*)<\/password>/i) { $pass = $1; }
- elsif(/<db>(.*)<\/db>/i) { $db = $1; }
- }
- # DATA SOURCE NAME
- my $dsn = "dbi:mysql:$db:localhost:3306";
- # PERL DBI CONNECT
- my $connect = DBI->connect($dsn, $user, $pass);
- return $connect;
- } # End LoadMySQLConnection()
- ### Establish a Connection with password from Config File
- sub LoadMySQLConnection_Alternate
- {
- use DBI;
- use DBD::mysql;
- my $DATABASE_NAME = "XXXXXXXXXXXX";
- my $DATABASE_USER = "XXXXXXXXXXXX";
- my $DATABASE_PASSWORD = "XXXXXXXXXXXX";
- if ($DATABASE_PASSWORD eq "XXXXXXXXXXXX")
- {
- $client->Message(18, "ERROR! You forgot to update the database password in the sub LoadMySQLConnection2() function!! Search source for XXXXXXXXXXXX to find it.");
- }
- else
- {
- my $dsn = "DBI:mysql:database=$DATABASE_NAME;host=localhost";
- my $connect = DBI->connect($dsn, $DATABASE_USER, $DATABASE_PASSWORD);
- return $connect;
- }
- } # End LoadMySQLConnection()
- ### Very Simple: Get Qglobal Value and Return it
- sub GET_QGLOBAL_VALUE
- {
- # if(!$connect) { $connect = LoadMySQLConnection(); }
- my $connect = LoadMySQLConnection();
- my $qglobal_name = $_[0];
- my $a_name = "NULL";
- my $b_value = "0";
- my $query = "SELECT name, value FROM quest_globals WHERE name = '$qglobal_name' LIMIT 1";
- # quest::gmsay("$query", 18, 0);
- my $query_handle = $connect->prepare($query);
- $query_handle->execute();
- if ($query_handle->rows)
- { # START GET 1 RECORD
- my $ref = $query_handle->fetchrow_hashref();
- $a_name = $ref->{'name'};
- $b_value = $ref->{'value'};
- } # END GET 1 RECORD
- $query_handle->finish();
- $connect->disconnect();
- return $b_value;
- } # End GET_QGLOBAL_VALUE()
- ### Check if Qglobal is expired, return 0 for expired, and return 1 for not expired
- ### This is required for SPAM timer to create/delete instances
- sub GET_QGLOBAL_VALUE_EXPIRE
- {
- # if(!$connect) { $connect = LoadMySQLConnection(); }
- my $connect = LoadMySQLConnection();
- my $qglobal_name = $_[0];
- my $a_name = "NULL";
- my $b_value = "0";
- my $c_expdate = 0;
- my $query = "SELECT name, value, expdate FROM quest_globals WHERE name = '$qglobal_name' LIMIT 1";
- my $query_handle = $connect->prepare($query);
- $query_handle->execute();
- ### EITHER GET RECORD OR RETURN 0 FOR EXPIRED
- if ($query_handle->rows)
- { # START GET 1 RECORD
- my $ref = $query_handle->fetchrow_hashref();
- $a_name = $ref->{'name'};
- $b_value = $ref->{'value'};
- $c_expdate = $ref->{'expdate'};
- $query_handle->finish();
- $connect->disconnect(); # After getting 1 record, go ahead finish and disconnect, then compare time if expired
- } # END GET 1 RECORD
- else # else no records are retrieved, therefore it doesn't exist and/or expired, return 0
- {
- # quest::gmsay("GET_QGLOBAL_VALUE_EXPIRE -1: DOES NOT EXIST!", 18, 0);
- $query_handle->finish();
- $connect->disconnect(); # If no record, then finish and disconnect before return
- return 0;
- }
- ### IF RECORD THEN FIND OUT IF THE TIME IS EXPIRED
- if ($c_expdate > time())
- {
- # quest::gmsay("GET_QGLOBAL_VALUE_EXPIRE 1: NOT EXPIRED", 18, 0);
- return 1;
- }
- else
- {
- # quest::gmsay("GET_QGLOBAL_VALUE_EXPIRE 0: EXPIRED", 18, 0);
- return 0;
- }
- } # End GET_QGLOBAL_VALUE_EXPIRE()
- #################################################################################################################################
- ### START GM ONLY ###############################################################################################################
- sub FIND_PLAYER_INSTANCE
- {
- my $connect = LoadMySQLConnection(); # Connect to DB
- my $temp_id = 0;;
- my $temp_name = "NA";
- my $temp_x = 0;
- my $temp_y = 0;
- my $temp_z = 0;
- my $temp_zonename = "NA";
- my $temp_instanceid = 0;
- my $ZoneSNTOID = 0;
- my $query = "SELECT id, name, x, y, z, zonename, instanceid FROM character_ WHERE name = '$_[0]' ORDER BY id DESC LIMIT 1";
- my $query_handle = $connect->prepare($query);
- $query_handle->execute();
- # GET 1 RECORD
- if($query_handle->rows)
- {
- my $ref = $query_handle->fetchrow_hashref();
- $temp_id = $ref->{'id'};
- $temp_name = $ref->{'name'};
- $temp_x = $ref->{'x'};
- $temp_y = $ref->{'y'};
- $temp_z = $ref->{'z'};
- $temp_zonename = $ref->{'zonename'};
- $temp_instanceid = $ref->{'instanceid'};
- $ZoneSNTOID = ListZoneSNToID2($temp_zonename);
- }
- $query_handle->finish();
- $connect->disconnect();
- if ($temp_name eq "NA")
- {
- $client->Message(7, "$_[0] not found!");
- }
- else
- {
- my $GOTO_PLAYER_LINK = quest::saylink("goto " . $temp_name, 1);
- $client->Message(7, " ");
- $client->Message(7, "Info for: $temp_name");
- $client->Message(7, "Char ID = $temp_id");
- $client->Message(7, "Char X = $temp_y");
- $client->Message(7, "Char Y = $temp_x");
- $client->Message(7, "Char Z = $temp_z");
- $client->Message(7, "Zone Name = $temp_zonename");
- $client->Message(7, "Instance ID = $temp_instanceid");
- $client->Message(7, "$GOTO_PLAYER_LINK");
- }
- } # End FIND_PLAYER_INSTANCE()
- #################################################################################################################################
- #################################################################################################################################
- sub GOTO_PLAYER_INSTANCE
- {
- my $connect = LoadMySQLConnection(); # Connect to DB
- my $temp_id = 0;;
- my $temp_name = "NA";
- my $temp_x = 0;
- my $temp_y = 0;
- my $temp_z = 0;
- my $temp_zonename = "NA";
- my $temp_instanceid = 0;
- my $ZoneSNTOID = 0;
- my $query = "SELECT id, name, x, y, z, zonename, instanceid FROM character_ WHERE name = '$_[0]' ORDER BY id DESC LIMIT 1";
- my $query_handle = $connect->prepare($query);
- $query_handle->execute();
- # GET 1 RECORD
- if($query_handle->rows)
- {
- my $ref = $query_handle->fetchrow_hashref();
- $temp_id = $ref->{'id'};
- $temp_name = $ref->{'name'};
- $temp_x = $ref->{'x'};
- $temp_y = $ref->{'y'};
- $temp_z = $ref->{'z'};
- $temp_zonename = $ref->{'zonename'};
- $temp_instanceid = $ref->{'instanceid'};
- $ZoneSNTOID = ListZoneSNToID2($temp_zonename);
- }
- $query_handle->finish();
- $connect->disconnect();
- $client->Message(7, " ");
- if ($temp_instanceid > 0)
- {
- $client->Message(7, "$temp_name is in instance id $temp_instanceid.");
- $client->Message(7, "Zoning to $temp_zonename.");
- quest::AssignToInstance($temp_instanceid);
- quest::MovePCInstance($ZoneSNTOID, $temp_instanceid, $temp_x, $temp_y, $temp_z);
- }
- elsif ($temp_id > 0)
- {
- $client->Message(7, "$temp_name does not have instance.");
- $client->Message(7, "Zoning to $temp_zonename.");
- quest::movepc($ZoneSNTOID,$temp_x,$temp_y,$temp_z);
- }
- else
- {
- $client->Message(7, "Character $_[0] does not exist!");
- }
- } # End GOTO_PLAYER_INSTANCE()
- ### END GM ONLY #################################################################################################################
- #################################################################################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement