Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 06-24-2016, 10:34 PM
DanCanDo's Avatar
DanCanDo
Discordant
 
Join Date: May 2016
Location: Above Hell
Posts: 400
Default

Just thought I would share what the end results were for an npc to set the
player status (increase). Just in case anyone else is interested in using it.
This is all with the great help of ghanja
In the plugins folder, the MySQL.pl file was renamed to MySQL(old).pl but you
can use whatever you want. A new one was created with the following:
You will have to EDIT the credentials for your DB.(database name, password)
Code:
sub MySQL_Connect {
	use DBI;
	use DBD::mysql;
	$dbh = DBI->connect("DBI:mysql:peq:127.0.0.1:3306;", "root", "password", {RaiseError => 1});
	return $dbh;
}

return 1;
Then the script was put on NPC. You can EDIT the value for whatever your
desired status is needed to be raised to. (this one raises it from 0 to 1)
It also requires a level of 10 before the NPC will raise it for you. You can edit
that to your likings. I've tested this 3 times now and all working good.
Code:
sub EVENT_SAY {
	if ($text=~/hail/i && $status == 0 && $ulevel >= 10) {
		my $actid = $client->AccountID();
		UpdateStatus($actid,1);
		quest::say ("Welcome $name Your status has been raised to 1.");
	}
} 
	
sub UpdateStatus {
	my $idargument = $_[0];
	my $statuslevel = $_[1];
	my $dbh = plugin::MySQL_Connect();
	my $query = "UPDATE account SET status = ".$statuslevel." WHERE id = ".$idargument.";";
	$dbh->do($query);
	$dbh->disconnect();
	$client->UpdateAdmin();
}
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 09:19 AM.


 

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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3