Go Back   EQEmulator Home > EQEmulator Forums > Support > Spell Support

Spell Support Broken Spells? Want them Fixed? Request it here.

Reply
 
Thread Tools Display Modes
  #1  
Old 01-04-2019, 04:14 PM
ErikSigvard
Fire Beetle
 
Join Date: Jan 2019
Location: Cheyenne, WY
Posts: 11
Default NPC Rezzer in Guild Lobby

Need some assistance with this, pretty please.

I've created an NPC in the guild lobby who I would like to offer rezzes for plat. The problem I'm running into is how to get them to target the corpse and cast the rez spell. Everything else works just fine.

Has anyone done this and is willing to offer up a sample of their quest code?
Reply With Quote
  #2  
Old 02-23-2021, 09:26 PM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,332
Default

Since this post got necro'd and the OP never got a reply back then, figure I would throw in a old simple script I used to use for an NPC to summon and rez. In this example, the npc asks for an emerald, but that item can be changed to one's preferences. Just place this in a file named after the npc you created npcname.pl and put it in the appropriate quests/zone folder.

Don't forget to #reloadquest after it's all setup.

Code:
sub EVENT_SPAWN {
   $x = $npc->GetX();
   $y = $npc->GetY();
   quest::set_proximity($x - 500, $x + 500, $y - 500, $y + 500);
}

sub EVENT_SAY {
  my $saylink1 = quest::saylink("REZ");
  if (($text=~/hail/i) && ($ulevel<99)) {
	$client->Message(315,"Hello $name, Bring me an Emerald and I can gather your pathetic bones for you. I can also give you a [$saylink1] if you wish.");
  }
  if (($text=~/rez/i) && ($ulevel<99)) {
	  my $charid = $client->GetID();
	  if($text=~/rez/i) {
            my $corpse = $entity_list->GetCorpseByOwner($client);
            $client->Message(315,'Ok, Stand by '.$corpse->GetOwnerName().' I am rezzing your corpse.');
            $corpse_id = $corpse->GetID();
            $npc->CastSpell(1524,$corpse_id);
      }
  }
}

sub EVENT_ITEM {
$failure = "Sorry $name I can not help you.";


	if(plugin::check_handin(\%itemcount, 10029 => 1))
	{
		if ($ulevel<86)
		{
			EVENT_SUMMON();
		}
		else
		{
			quest::say($failure);
			quest::summonitem(10029);
		}
	}
}

sub EVENT_SUMMON {
$charid = $client->CharacterID();
$count = $client->GetCorpseCount();
$x = $client->GetX();
$y = $client->GetY();
$z = $client->GetZ();
	
	if($count > 0)
	{
    		quest::summonallplayercorpses($charid,$x,$y,$z,0);
			$client->Message(315,"There is the bones you left behind $name . See you again sometime.");
	}
	
	else {
			$client->Message(315,"You have no corpses $name, take this back.");
			quest::summonitem(10029);
	}
}
__________________
Hanging out at Antonica.World
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 09:30 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3