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

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

Reply
 
Thread Tools Display Modes
  #1  
Old 10-12-2015, 06:40 AM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default Assistance: Target self to cast spell requiring self/group

I'm writing a custom .lua script which, I hope, will summon a corpse using the necro spell, id = 3 (summon corpse). The only piece I seem to be missing is something which will force the client/player to target himself.

I've grep searched the quest folder and google but could not find/understand what I am looking for. I've tried a couple dozen different variations on things including depopping the quest npc. I think I am simply missing the command/function to target self.

Below is what I have so far with <location of target code> to indicate where I think it should belong.

Code:
-- global\a_dungeon_necromancer.lua NPCID

function event_say(e)
	if(e.message:findi("hail")) then
		e.self:Say("I know the reason you come to see me, " .. e.other:GetName() .. ". Don't be afraid, the living do not concern me... You require my [services], you must ask for them. Only the willing are allowed when living.");
	elseif(e.message:findi("services")) then
		e.self:Say("" .. e.other:GetName() .. ", to perform the necessary incantation, you must hand me one platinum, three gold, three silver and seven copper pieces.");
	end
end

function event_trade(e)
	local item_lib = require("items");
	local leet_cash = 0;
	if(item_lib.check_turn_in(e.trade, {platinum = 1, gold = 3, silver = 3, copper = 7})) then

		leet_cash = 1;
	end

	if(leet_cash >= 1) then

--			<location of target code>
			
			eq.SelfCast(3);
			if(leet_cash == 1) then
				e.self:Say("Believe me when I say this exact amount represents the services offered.");
				leet_cash = 0;
		end

	end
	item_lib.return_items(e.self, e.other, e.trade)
end
Thanks
Reply With Quote
  #2  
Old 10-12-2015, 11:59 AM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Are you just trying to have the script summon it's own corpse? Use the corpse summoner scripts that already exist.
Reply With Quote
  #3  
Old 10-12-2015, 03:09 PM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

If you are referring to the scripts for Dragons of Norrath and the guild lobby, I've looked at them and they will no do what I want them to do. I want to summon a corpse with the same behavior as the NEC spell "summon corpse".

Everything appears to work except self targeting. Since the npc is targeted at the end of the script and the spell is self (player) cast, the text stating "Your target must be a group member for this spell." appears.

If anyone knows how to accomplish what I am trying to do, please share.

Thanks
Reply With Quote
  #4  
Old 10-15-2015, 02:56 AM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

Resolved

$client->SetTarget($client);

That's all that was needed in the .pl file.

Code:
# global\a_dungeon_necromancer.pl NPCID


sub EVENT_SAY  {
	if ($text=~/hail/i) {
		quest::say("I know the reason you come to see me, $name. Don't be afraid, the living do not concern me... You require my [services], you must ask for them. Only the willing are allowed when living.");
	}
	if ($text=~/services/i) {
	    quest::say("$name, to perform the necessary incantation, you must hand me one platinum, three gold, three silver and seven copper pieces.");

	}
}

sub EVENT_ITEM {
	if (plugin::takeCoin(1000)) {
		quest::say("Believe me when I say this exact amount represents the services offered and becomes transmuted into the much larger pile of where, I only know. HAHA!");
		$client->SetTarget($client);
		quest::selfcast(3);
	}
	plugin::returnUnusedItems();
}
Thanks
Reply With Quote
  #5  
Old 10-15-2015, 03:08 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

Glad you got it worked it!
Reply With Quote
  #6  
Old 10-15-2015, 03:47 AM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

Thank you sir! credit where it's due ^^^ KK
Reply With Quote
  #7  
Old 10-15-2015, 03:53 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

Haha, you're welcome. Feel free to message me if you need anymore assistance.
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 11:40 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