Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-24-2018, 10:12 PM
superpally1
Sarnak
 
Join Date: Jul 2018
Location: Tennessee
Posts: 33
Default Server variables changed easily

I know changing variables in the database is easily done with heidisql and other programs. It is nice to be able to change the values while in the game to.
I made this code to show how to change hot zones from within the game using an npc http://www.eqemulator.org/forums/sho...238#post260238
and found it useful myself.
So I added a few more options to it. Maybe some of you will also find it useful.
All of the directions are at the top of the script.
This can be used for an npc people hail and get a list of current hotzones. They can not change anything.
The reason for this code: $say_links = quest::saylink("$zone_row[0]", 1);
$client->Message(15,"$say_links.");

I added all of this to Kingly_Krab's custom teleporter script and wanted the hotzones to be clicked and teleported to like in his script for teleporting. I can also post it all together if he doesn't mind and someone would like to have it.

Code:
#
#
# Can be used for an NPC that will only list current hot zones to players with status < 150
#
#
# Must have status > 150 to change server settings.
#
#
# To change hotzones type: /say add hotzone zonesn or /say remove hotzone zonesn.
# Example: /say add hotzone nro
# This would add nro to the hotzone list.
# Example: /say remove hotzone nro
# This would remove nro from the hotzone list.
#
#
# To set the AA XP Modifier value, type /say set aaxpmod value
# Example : /say set aaxpmod 1.50
# This would set the AA XP Modifier to double the default setting. (default = 0.75)
#
#
# To set the EXP Modifier value, type /say set expmod value
# Example : /say set expmod 1.50
# This would set the EXP Modifier to double the default setting. (default = 0.75)
#
#
# To set the Group EXP Modifier value, type /say set groupexpmod value
# Example : /say set groupexpmod 1.20
# This would set the Group EXP Modifier to double the default setting. (default = 0.60)
#
#
# To set the Global Loot Multiplier value, type /say set lootmod value
# Example : /say set lootmod 2
# This would set the Global Loot Multiplier to double the default setting. (default = 1)
#
#
sub EVENT_SAY {
	@args = split(' ', $text);
 	if ($text=~/hail/i) {
		$client->Message(15,""  .quest::saylink("Current hotzones", 1)."");
		if($status > 150) {
		    $client->Message(15,""  .quest::saylink("Server Settings", 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) {
		    $client->Message(12,"To change hotzones type: /say add hotzone zonesn or /say remove hotzone zonesn.");
		    $client->Message(12,"Example: /say add hotzone nro");
		    $client->Message(12,"This would add nro to the hotzone list.");
		    $client->Message(12,"Example: /say remove hotzone nro");
		    $client->Message(12,"This would remove nro from the hotzone list.");
		}
	}
	if($status > 150) {
	    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;
	    }
	    if($text=~/Server Settings/i) {
	        $client->Message(15,"Display_"  .  quest::saylink("AA XP Modifier", 1)  .  ".");
		$client->Message(15,"Display_"  .  quest::saylink("EXP Modifier", 1)  .  ".");
		$client->Message(15,"Display_"  .  quest::saylink("Group EXP Modifier", 1)  .  ".");
		$client->Message(15,"Display_"  .  quest::saylink("LOOT Multiplier", 1)  .  ".");
	    }
	    if($text=~/AA XP Modifier/i) {
	        $client->Message(15,"Current AA XP Modifier is : ");
		my $connect = plugin::LoadMysql();
		my $sql_query = ("SELECT value FROM variables WHERE varname='AAXPMod'");
		my $sql_handler = $connect->prepare($sql_query);
		$sql_handler->execute();
                @data_found = $sql_handler->fetchrow_array();
		$client->Message(15,"$data_found[0].");
		$connect->disconnect();
		$client->Message(12,"Default value is 0.75");
		$client->Message(12,"To set the AA XP Modifier value, type /say set aaxpmod value");
		$client->Message(12,"Example : /say set aaxpmod 1.50");
		$client->Message(12,"This would set the AA XP Modifier to double the default setting.");
	    }
	    if($text=~/set aaxpmod/i) {
                my $connect = plugin::LoadMysql();
                $query = ("UPDATE variables SET value='$args[2]' WHERE varname='AAXPMod'");
                $query_handle = $connect->prepare($query);
                $query_handle->execute();
		$connect->disconnect;
                $client->Message(14,"AA XP Modifier set to : $args[2].");	
            }
	    if($text=~/EXP Modifier/i) {
	        $client->Message(15,"Current EXP Modifier is : ");
	        my $connect = plugin::LoadMysql();
	        my $sql_query = ("SELECT value FROM variables WHERE varname='EXPMod'");
	        my $sql_handler = $connect->prepare($sql_query);
	        $sql_handler->execute();
                @data_found = $sql_handler->fetchrow_array();
	        $client->Message(15,"$data_found[0].");
	        $connect->disconnect();
	        $client->Message(12,"Default value is 0.75");
	        $client->Message(12,"To set the EXP Modifier value, type /say set expmod value");
	        $client->Message(12,"Example : /say set expmod 1.50");
	        $client->Message(12,"This would set the EXP Modifier to double the default setting.");
	    }
	    if($text=~/set expmod/i) {
                my $connect = plugin::LoadMysql();
                $query = ("UPDATE variables SET value='$args[2]' WHERE varname='EXPMod'");
                $query_handle = $connect->prepare($query);
                $query_handle->execute();
                $connect->disconnect;
                $client->Message(14,"EXP Modifier set to : $args[2].");
            }
	    if($text=~/Group EXP Modifier/i) {
	        $client->Message(15,"Current Group EXP Modifier is : ");
		my $connect = plugin::LoadMysql();
		my $sql_query = ("SELECT value FROM variables WHERE varname='GroupEXPBonus'");
		my $sql_handler = $connect->prepare($sql_query);
	        $sql_handler->execute();
                @data_found = $sql_handler->fetchrow_array();
		$client->Message(15,"$data_found[0].");
		$connect->disconnect();
		$client->Message(12,"Default value is 0.60");
		$client->Message(12,"To set the Group EXP Modifier value, type /say set groupexpmod value");
		$client->Message(12,"Example : /say set groupexpmod 1.20");
		$client->Message(12,"This would set the Group EXP Modifier to double the default setting.");
	    }
	    if($text=~/set groupexpmod/i) {
                my $connect = plugin::LoadMysql();
                $query = ("UPDATE variables SET value='$args[2]' WHERE varname='GroupEXPBonus'");
                $query_handle = $connect->prepare($query);
                $query_handle->execute();
                $connect->disconnect;
                $client->Message(14,"Group EXP Modifier set to : $args[2].");	
            }
	    if($text=~/LOOT Multiplier/i) {
	        $client->Message(15,"Current Global Loot Multiplier is : ");
		my $connect = plugin::LoadMysql();
		my $sql_query = ("SELECT rule_value FROM rule_values WHERE rule_name='Zone:GlobalLootMultiplier'");
		my $sql_handler = $connect->prepare($sql_query);
		$sql_handler->execute();
                @data_found = $sql_handler->fetchrow_array();
		$client->Message(15,"$data_found[0].");
		$connect->disconnect();
		$client->Message(12,"Default value is 1");
		$client->Message(12,"To set the Global Loot Multiplier value, type /say set lootmod value");
		$client->Message(12,"Example : /say set lootmod 2");
		$client->Message(12,"This would set the Global Loot Multiplier to double the default setting. (Double Loot)");
	    }
	    if($text=~/set lootmod/i) {
                my $connect = plugin::LoadMysql();
                $query = ("UPDATE rule_values SET rule_value='$args[2]' WHERE rule_name='Zone:GlobalLootMultiplier'");
                $query_handle = $connect->prepare($query);
                $query_handle->execute();
                $connect->disconnect;
                $client->Message(14,"Global Loot Multiplier set to : $args[2].");		
            }
	}
}
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:03 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3