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

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 07-21-2013, 09:00 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default Placing "Groundspawns"

Another silly script.. but this makes things go a bit faster if you are trying to add groundspawns to a zone!


Just type --- "groundspawn 1001" -- it spawn place a groundspawn of itemid 1001 in your current location

This requires DBI and the way it is currently written requires status 200 to be able to spawn the items

If you spawn an item that has a viewable graphic it will show up as that on the ground rather than the generic bag graphic.

Code:
sub EVENT_SAY {


	if($status >= 200)
	{
			if($text=~/^groundspawn/i)
			{
				my $itemdrop = substr($text, 12);
				my $CX = $client->GetX();
				my $CY = $client->GetY();
				my $CZ = $client->GetZ();
				my $CH = $client->GetHeading();
				my $dbh = DBI_CONNECT();
				$sth = $dbh->prepare("SELECT idfile FROM items WHERE id = $itemdrop");
				$sth->execute();
				my $graphic = $sth->fetchrow_array();
				$sth = $dbh->do("INSERT INTO `ground_spawns` VALUES ('', $zoneid, 0, $CX, $CY, $CZ, $CX, $CY, $CH, '".$graphic."_ACTORDEF', $itemdrop, 1, 'Auto', 300000)");
				$dbh->disconnect();
				$client->Message(315, "Groundspawn added to $zonesn!");
			}
	}

}



sub DBI_CONNECT {
	use DBI;
	$database = "peq";
	$host = "localhost";
	$username = "USERNAME";
	$password = "PASSWORD";
	$dbh = DBI->connect("DBI:mysql:database=$database;host=$host", "$username", "$password", {RaiseError => 1});
	return $dbh;
}
Reply With Quote
  #2  
Old 07-21-2013, 10:10 PM
Drakiyth's Avatar
Drakiyth
Dragon
 
Join Date: Apr 2012
Posts: 549
Default

This is a really cool script, Natedog. Thanks for making it.
Reply With Quote
  #3  
Old 07-22-2013, 07:55 AM
jsr
Hill Giant
 
Join Date: Aug 2008
Location: melbourne
Posts: 188
Default

Great idea, cheers!
Reply With Quote
Reply


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:51 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