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