[Resolved] Problems with AddTimer()

General support forum. If you require assistance and your problem doesnt fall in any of the other categories, this is the forum for you!

Moderator: Team Members

Forum rules
READ THE FORUM STICKY THREADS BEFORE ASKING FOR HELP!
Most information can be found there, and if not, the posts will help you determine the information required to get assistance from the development team.
Incomplete Help Requests will be locked or deleted.
Post Reply
bolly
Retired
Posts: 389
Joined: Mon Sep 21, 2009 3:03 pm
Location: Leeds, UK

[Resolved] Problems with AddTimer()

Post by bolly » Thu Nov 19, 2009 12:40 pm

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
Last edited by bolly on Sat Nov 21, 2009 12:52 pm, edited 1 time in total.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Problems with AddTimer()

Post by Scatman » Thu Nov 19, 2009 1:34 pm

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.

bolly
Retired
Posts: 389
Joined: Mon Sep 21, 2009 3:03 pm
Location: Leeds, UK

Re: Problems with AddTimer()

Post by bolly » Thu Nov 19, 2009 2:28 pm

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

bolly
Retired
Posts: 389
Joined: Mon Sep 21, 2009 3:03 pm
Location: Leeds, UK

Re: [Resolved] Problems with AddTimer()

Post by bolly » Sat Nov 21, 2009 12:52 pm

Tick does indeed rock thanks man!

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests