Time remaining on a qglobal
Is there a way to have a qglobal's remaining time read and displayed to players?
|
There are a couple plugins that read and convert Unix timestamps. They are contained in the time_tools.pl
Code:
###Usage: my $TimeLeft = plugin::GetTimeLeft(UnixTime, ReturnType=0); Code:
###Usage: my $EndTime = plugin::GetEndTime("TypeDur", localtime=false); Here is a sample of how I have it currently used on my server. Code:
my $myInstance = $dbh->prepare("SELECT * FROM quest_globals WHERE charid = $charID and name like 'Skylance';"); |
Once this pull request gets committed, this will be possible without Perl DBI. There is a plugin, as mentioned, called plugin::GetTimeLeft(), I have re-written this plugin along with NatedogEZ to return time from Years downwards (includes months and weeks). The syntax for $client->GetGlobalTime() is $client->GetGlobalTime("qglobal_name", character_id, npc_id, zone_id); NatedogEZ and I did not default character_id, npc_id, and zone_id to 0, so you must specify 0 if you don't want it to search for specific NPCs or zones. Along with this commit comes $client->GetGlobal() which has the exact same syntax, $client->GetGlobal("qglobal_name", character_id, npc_id, zone_id); This will return the value of a quest global based on NPC or Client, as it is for mobs. This will allow you to do such things as check your target's quest global using $client->GetTarget()->GetGlobal(); if you meet the correct conditions. I apologize for rambling.
Here's the plugin, to use it do the following: $client->Message(Color #, plugin::GlobalTime($client->GetGlobalTime("qglobal_name", character_id, npc_id, zone_id))); Code:
sub GlobalTime { |
All times are GMT -4. The time now is 10:33 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.