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

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 07-30-2015, 01:49 AM
Rabuk
Fire Beetle
 
Join Date: Jul 2015
Posts: 14
Default quest:selfcast in LUA

heya,
i trying to get this command to run in LUA to setup an buff npc.

But i cant get this working with LUA.

Code:
function event_say(e)
	local myid = e.other:GetID();
	if(e.message:findi("hail")) then
		e.self:Say("Welcome, do you want some [" .. eq.say_link("buffs",false,"buffs") .. "]?");
	elseif (e.message:findi("buffs")) then
		e.self:CastToClient(18323, myid);
	end
end
The npc starts always to cast on him self. I tried all kind of combinations but i dont get the npc to cast a spell on me. I checked the return id from the function GetID and it looks ok.

I was not able to find any examples on the forum / web. And the LUA reference doesnt have any command for selfcast or something.

Thanks in advance for any hints.

Edit: Oh i see there is a quest:lua forum. Maybe someone can move this. Sorry for that.
Reply With Quote
  #2  
Old 07-30-2015, 02:00 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

Haven't really messed with our Lua that much, but try this:
Code:
function event_say(e)
    local myid = e.other:GetID();
    if(e.message:findi("hail")) then
        e.self:Say("Welcome, do you want some [" .. eq.say_link("buffs",false,"buffs") .. "]?");
    elseif (e.message:findi("buffs")) then
        e.self:CastSpell(18323, myid);
    end
end
Reply With Quote
  #3  
Old 07-30-2015, 04:14 AM
Rabuk
Fire Beetle
 
Join Date: Jul 2015
Posts: 14
Default

Hello,
will check it out later when iam back home from work.

I wonder why i did use CastToClient instead of CastSpell.
Ofcourse it was to later yesterday. haha
Reply With Quote
  #4  
Old 07-30-2015, 04:24 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

Yeah, haha, no problem, not sure if my code will work or not, but probably worth trying at least.
Reply With Quote
  #5  
Old 07-30-2015, 11:53 AM
Rabuk
Fire Beetle
 
Join Date: Jul 2015
Posts: 14
Default

The only way i got this running now is by using "other" instead of "self".

Code:
e.other:CastSpell(18323, myid, 0, 0, 0);
So this will come close to the selfcast function in perl.

Thank you !
Reply With Quote
  #6  
Old 07-30-2015, 12:30 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

You can use..

Code:
eq.SelfCast(18323);

It makes the initiator of the quest self cast

If you are wonder where that is from its from the folder "lua_modules\general_ext.lua"
Reply With Quote
  #7  
Old 07-30-2015, 01:13 PM
Rabuk
Fire Beetle
 
Join Date: Jul 2015
Posts: 14
Default

Quote:
Originally Posted by NatedogEZ View Post
You can use..

Code:
eq.SelfCast(18323);

It makes the initiator of the quest self cast

If you are wonder where that is from its from the folder "lua_modules\general_ext.lua"
Oh cool didnt know it.
I was reading the lua reference but didnt see this function.

Cool thank you.
Reply With Quote
Reply


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 03:50 AM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3