EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Spell Support (https://www.eqemulator.org/forums/forumdisplay.php?f=664)
-   -   Issue with self.CastSpell() and KEI, VOQ, + (https://www.eqemulator.org/forums/showthread.php?t=42250)

ErikSigvard 01-03-2019 10:44 AM

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


ErikSigvard 01-03-2019 03:16 PM

I got Perl working correctly on my server, and I find it to be easier to work with than LUA (JUST my personal opinion!), so I am converting my two little bots to Perl.

Although, I see the same issue occurs on the Perl side with KEI and VOQ - doing $npc->CastSpell with either of those spells causes them to never actually land. But doing quest::selfcast allows them to work.

As long as it doesn't show the character casting the spell, I am satisfied, from a roleplaying perspective.

phate8908 01-03-2019 07:20 PM

short explination:
use 2970 instead of 2570...

long explination:
npcs behave odd with group spells, they can't use the mechanic target group buff so, any group buff will cast on the npc's "group"... you are not a part of the npc's "group" so... sorry, you can't do that... kinda makes sense tbh...

ErikSigvard 01-04-2019 04:25 PM

Sigh...I feel like a dumbass. Duh. It's a group spell. I didn't even think about that. Thank you.


All times are GMT -4. The time now is 08:55 AM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.