View Single Post
  #9  
Old 03-04-2012, 06:12 PM
blackdragonsdg
Dragon
 
Join Date: Dec 2008
Location: Tennessee
Posts: 656
Default

A couple of years ago I toyed around with level restricted and status based progression and while I never mastered controlling the sql execution with in a quest script the following might help you get started.

Using the example below....After Cazic Thule was killed I would spawn the Ghost_of_Fear which would cause the entire script to execute. The sql execution is uncontrolled once this script starts which is the part I never mastered.

Ghost_of_Fear.pl
Code:
sub EVENT_SPAWN {
quest::settimer(55,1200);
quest::shout2("Cazic Thule has fallen...Ruins of Kunark is now available")
}

use DBI;

# connect
my $dbh = DBI->connect("DBI:mysql:database=peq;host=localhost", "root", "password", {'RaiseError' => 1});

# execute update query
my $columns = $dbh->do("update zone set min_level = 0 where expansion = 2;");

# disconnect
$dbh->disconnect();


sub EVENT_TIMER {
if($timer == 55) {
	quest::stoptimer(55);
	quest::depop();
	}
}
If you can make the sql execution controllable then you would be set and can do so from within Cazic Thules script instead of a secondary spawns script. You will need a couple of add ons for perl to get this to work...DBD-mysql and DBI I think were the only ones that were required but I added the following as well DBD-mysqlPP, MySQL-Config, MySQL-DateFormat, MySQL-Easy, MySQL-Insert, MySQL-Locker, MySQL-Log-ParseFilter, MySQL-NameLocker, MySQL-Sandbox and MySQL-SlowLogFilter.
Reply With Quote