PDA

View Full Version : Any in-game method to determine if a zone is flagged as a "hot zone"?


irongut_av
09-21-2018, 02:11 PM
Is there a quest script or method call in Lua/Perl than can retrieve zone information (such as if the zone is a hot-zone)?

Thanks.

superpally1
09-22-2018, 02:08 PM
I dont think this is posted in the right area. But this should do what you want.


# Must have status of 150+ to use add/remove commands.
# Usage: /say add hotzone zonesn
# Usage: /say remove hotzone zonesn
# Example: /say add hotzone nro This will add nro to the hotzone list.
# Example: /say remove hotzone nro This will remove nro from the hotzone list.

sub EVENT_SAY {
@args = split(' ', $text);

if($text=~/hail/i) {
$client->Message(15, quest::saylink("Current hotzones", 1));
}
if($text=~/Current hotzones/i) {
$client->Message(15,"Current hotzones are : ");
my $connect = plugin::LoadMysql();
my $found_zone = 0;
my $sql_query = "SELECT short_name FROM zone WHERE hotzone=1";
my $sql_handler = $connect->prepare($sql_query);
$sql_handler->execute();
while (@zone_row = $sql_handler->fetchrow_array()) {
$found_zone++;
$say_links = quest::saylink("$zone_row[0]", 1);
$client->Message(15,"$say_links.");
}
$connect->disconnect();
}
if($status > 150) { #Change this to the status you want.
if($text=~/add hotzone/i) {
my $connect = plugin::LoadMysql();
$query = "UPDATE zone SET hotzone = 1 WHERE short_name = '$args[2]'";
$client->Message(14,"$args[2], added to hotzone list.");
$query_handle = $connect->prepare($query);
$query_handle->execute();
$connect->disconnect;
}
if($text=~/remove hotzone/i) {
my $connect = plugin::LoadMysql();
$query = "UPDATE zone SET hotzone = 0 WHERE short_name = '$args[2]'";
$client->Message(13,"$args[2], removed from hotzone list.");
$query_handle = $connect->prepare($query);
$query_handle->execute();
$connect->disconnect;
}
}
}

superpally1
09-22-2018, 02:32 PM
oops double post

irongut_av
09-23-2018, 08:32 PM
Thanks, just what I was looking for!