Page 1 of 1

[Resolved] Problems with AddTimer()

Posted: Thu Nov 19, 2009 12:40 pm
by bolly
Hey all,

Got a problem with AddTimer, doesn't seem to trigger for me - the cast is fine but Curse() doesn't

Don't see any messages with luadebug start on

Can anyone help?

Code: Select all

--[[
	This is the EQ2Emu generic spell damage script written in LUA.
	These functions are shared, so don't save any character data in them.
	If you have any questions be sure to read the readme.txt file located in this directory
--]]

--main process function
function cast(Caster, Target, DamageType, Damage)
	SendPopUpMessage(Caster, "Your target is hit by Taliesins Curse")
	AddTimer(Target, 6000, "Curse", 5, Caster)
end

function remove(Caster, Target)
end

function Curse(NPC, Player)
	ModifyHP(NPC, -30)
	AddHate(Player, NPC, 5)
	SendPopUpMessage(Player,"Your Taliesins Curse hit for 30 points of damage!")
end

Re: Problems with AddTimer()

Posted: Thu Nov 19, 2009 1:34 pm
by Scatman
In order for that to work you need the function curse in your target's spawn script. The tick function is more suitable to use for dots.

Re: Problems with AddTimer()

Posted: Thu Nov 19, 2009 2:28 pm
by bolly
Cheers scat, hadn't looked at the tick one yet it was just a quick test

Thanks for the info though, will try adding that to my spawns lua script then do the move to tick() asap

Re: [Resolved] Problems with AddTimer()

Posted: Sat Nov 21, 2009 12:52 pm
by bolly
Tick does indeed rock thanks man!