Ok so the spell effect is working and the move command works great. I definitely like this better. However, timers still aren't cooperating. I'm so close I can taste it:
Code:
sub EVENT_SPAWN {
quest::settimer("portercast",10);
}
sub EVENT_TIMER {
if($timer eq "portercast") {
quest::say("Casting...");
quest::stoptimer("portercast");
quest::say("Moved");
}
}
sub EVENT_SAY {
if ($text=~/Hail/i) {
plugin::Whisper("Hail! Where would you like to go? [Butcherblock] Mountains, The [Feerrott], North [Karana], [Lavastorm] Mountains, [Misty] Thicket, [South Ro], [Steamfont] Mountains, West [Commonlands] or [Toxxulia] Forest?");
}
elsif ($text=~/Commonlands/i) {
quest::say("Off to West Commonlands!");
quest::settimer("portercast",10);
}
# quest::movepc(21, 1427, 479, -51, 0);
}
I think maybe this is an order thing. What happens is:
1. I /say commonlands
2. NPC says "Off to West Commonlands!"
3. NPC starts spell effect
4. 10 seconds later NPC says "Casting..." immediately followed by "Moved".
Seems like I'm getting hung up in the EVENT_TIMERS sub. The "Casting..." and "Moved" are something I just added in for testing instead of loading constantly. "Moved" is where my move line would be. So if I move it down past where the portercast timer is called in EVENT_SAY, it triggers simultaneously as the timer and I end up with "Moved" before "Casting..."
I could put the move command in the EVENT_TIMERS sub, but then I would have to mess with multiple timers, which seems like it would be defeating the purpose of using the timer. When you call a timer like that, where does the actual timer pause take place? Within EVENT_TIMERS would seem to be the obvious answer. Is there not a way to make the EVENT_SAY steps pause until the timer call is complete?
Edit:
I tried adding the move command to the EVENT_TIMERS sub but it doesn't function at all there.