View Single Post
  #1  
Old 01-03-2019, 10:44 AM
ErikSigvard
Fire Beetle
 
Join Date: Jan 2019
Location: Cheyenne, WY
Posts: 11
Default Issue with self.CastSpell() and KEI, VOQ, +

Hi there.

I set up a buff bot in POK using LUA, and the script casts Clarity if the toon is 41 and under, Clarity 2 if they are 46 and under, and then KEI if they are over 46.

The script works perfect on Clarity and Clarity 2.

However, when casting KEI, you hear the casting sound but the spell never lands. When I change it to e.other:CastSpell(), it works perfect (but of course it's now the player casting the spell, not the NPC, and for some of us with OCD, a necro just can't cast KEI, dangit!). I tested also with VOQ in place of KEI and the same thing happens - you hear a spell being cast but nothing lands on the player. I waited for 5 minutes, so it definitely wasn't a spell cast and user-being-impatient issue.

I tried this with a level 60 character to ensure there wasn't a problem with the operator logic.

I also set my NPC to have 500,000 mana to ensure it wasn't an OOM issue.

Here is my code (and feel free to critique the code as well):

Code:
function event_say(e)
	if(e.message:findi("hail")) then
		e.self:Say("Hey there, newb! Need some mind candy [" .. eq.say_link('buffs', false, 'buffs') .. "]?");
	elseif(e.message:findi("buffs")) then
		if(e.other:GetLevel() < 42) then
			e.self:CastSpell(174, e.other:GetID(),0,0,0);
		elseif(e.other:GetLevel() < 46) then
			e.self:CastSpell(1693, e.other:GetID(),0,0,0);
		elseif(e.other:GetLevel() >= 46) then
			e.self:CastSpell(2570, e.other:GetID(),0,0,0);
		end
	end
end

Last edited by ErikSigvard; 01-03-2019 at 11:27 AM.. Reason: Minor typo
Reply With Quote