Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::LUA

Quests::LUA Section regarding LUA scripts, help, questions, answers

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 01-27-2015, 08:29 PM
silvergrin46
Fire Beetle
 
Join Date: Jan 2015
Posts: 9
Default Well I got it to work ... sort of ...

Below is the working script that corresponds to the example I posted about the spell that triggers the cast of either a
lower/higher rank pet summon spell depending upon the level of the caster.


Code:
function event_spell_effect(e)	

	local P_LVL = e.target:GetLevel();
	
		e.target:Message(15, "My CASTER_ID is: "..e.caster_id);		
		e.target:Message(15, "My LEVEL IS: "..P_LVL);
	
	if(P_LVL <=50) then		
		e.target:CastSpell(12001, e.caster_id); -- Summons lower level Pet
	
	elseif(P_LVL >50) then
		e.target:CastSpell(12002, e.caster_id); -- Summons higher level Pet
	
	end
end

This only works when casting the main spell via the #cast command.

From what I can figure out, when casting the main spell from a spell gem it must begin the cast and then process the script.

However, when using the #cast command it must process the script before the cast of the main spell actually takes place
because the appropriate second spell immediately begins its cast sequence when the command is activated.

I'm moving on to using the global_player.lua file for what I need until I can find another way, but I felt like sharing this information - maybe it will help someone.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:10 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3