View Single Post
  #67  
Old 10-13-2015, 02:27 PM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

I've tried a different approach with no success, so I try here:

I'm trying to come up with a script which, I hope, will summon a corpse using the necro spell, id = 3 (summon corpse).

I've looked at the Dragons of Norrath and the guild lobby quests 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. I've also tried to change the actual spell effect code.

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

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

Thanks
Reply With Quote