EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Making an NPC give off a spell aura (https://www.eqemulator.org/forums/showthread.php?t=39162)

provocating 12-29-2014 04:46 PM

Making an NPC give off a spell aura
 
When I say "aura" I mean a spell effect, but not actually casting the spell on the player. It does not look as classy when you see the NPC casting the spell. Is there a way of doing this in lua or perl, to have the NPC give off an aura of a spell like levitate when you get in their area?

I know how to do proximity and such, that is easy. I may be over-thinking the problem but let's say you have an invisible man and you want the players to have an effect like levitate when are 250 units from it, normally you would see "so and so cast levitate on Xalmat", I am trying to just get the effect to the player without them seeing the casting.

Kingly_Krab 12-29-2014 06:49 PM

If it's an invisible man you won't be able to see it anyway, haha, kidding. But you can just use $npc->SpellFinished(#, $client) in sub EVENT_ENTER.

EDIT: I'm not sure of how to stop the client form actually getting a message like a spell was cast on them, but at least this way it doesn't show, "NPC casts spell on client," you just get the spell message.

provocating 12-29-2014 07:31 PM

Know if there is a Lua way? I know people would have us do away with Perl altogether.

Kingly_Krab 12-29-2014 08:29 PM

Yeah, Lua has CastSpell. Reference: https://github.com/EQEmu/Server/wiki/Lua-Mob

Different types:
Code:

Boolean CastSpell(Integer spell_id, Integer target_id);
Boolean CastSpell(Integer spell_id, Integer target_id, Integer slot);
Boolean CastSpell(Integer spell_id, Integer target_id, Integer slot, Integer cast_time);
Boolean CastSpell(Integer spell_id, Integer target_id, Integer slot, Integer cast_time, Integer mana_cost);
Boolean CastSpell(Integer spell_id, Integer target_id, Integer slot, Integer cast_time, Integer mana_cost, Integer item_slot);
Boolean CastSpell(Integer spell_id, Integer target_id, Integer slot, Integer cast_time, Integer mana_cost, Integer item_slot, Integer timer, Integer timer_duration);
Boolean CastSpell(Integer spell_id, Integer target_id, Integer slot, Integer cast_time, Integer mana_cost, Integer item_slot, Integer timer, Integer timer_duration, Integer resist_adjust);


Coenxai 12-30-2014 10:39 AM

Quote:

Originally Posted by Kingly_Krab (Post 236399)
If it's an invisible man you won't be able to see it anyway, haha, kidding. But you can just use $npc->SpellFinished(#, $client) in sub EVENT_ENTER.

EDIT: I'm not sure of how to stop the client form actually getting a message like a spell was cast on them, but at least this way it doesn't show, "NPC casts spell on client," you just get the spell message.

Emptying cast_on (etc.) fields in spells_new

Kingly_Krab 12-30-2014 06:12 PM

Well yeah, haha, but I meant with just Perl/Lua.


All times are GMT -4. The time now is 08:35 PM.

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