trevius
08-05-2008, 11:13 PM
I don't know why, but I can't seem to get this command working. I have also tried quest::castspell(ID,Spell); but that doesn't seem to work in this quest either. I'm not quite sure what is wrong. This is an NPC that is supposed to be spawned during an event and then switch textures a few times and then depop and cause a really nasty AE if it isn't killed before the last timer finishes. It goes through all of the timers, but stops working on the last one. Though, if I remove "$npc->castSpell($client,6536);" the script completes as it should.
I have it set the variable $client to equal userid so that I am sure it is passing that info into the command. I am testing this with my GM char, but I have tried with invuln on or invuln off and with or without attacking the NPC. I can't get it to work no matter what I have tried.
#Explosive Storm
my $client;
sub EVENT_SPAWN {
quest::npctexture(3);
quest::settimer("start_storm",1);
}
sub EVENT_COMBAT {
if ($combat_state == 1) {
$client = $userid;
}
}
sub EVENT_TIMER {
if ($timer eq "start_storm") {
quest::stoptimer("start_storm");
quest::npctexture(3);
quest::settimer("change_storm1",5); }
if ($timer eq "change_storm1") {
quest::stoptimer("change_storm1");
quest::npctexture(2);
quest::emote("gains more energy and becomes less stable.");
quest::settimer("change_storm2",5); }
if ($timer eq "change_storm2") {
quest::stoptimer("change_storm2");
quest::npctexture(1);
quest::emote("gains even more energy and looks extremely dangerous.");
quest::settimer("change_storm3",5); }
if ($timer eq "change_storm3") {
quest::stoptimer("change_storm3");
$npc->castSpell($client,6536);
quest::emote("explodes and disperses.");
quest::depop(); }
}
I have it set the variable $client to equal userid so that I am sure it is passing that info into the command. I am testing this with my GM char, but I have tried with invuln on or invuln off and with or without attacking the NPC. I can't get it to work no matter what I have tried.
#Explosive Storm
my $client;
sub EVENT_SPAWN {
quest::npctexture(3);
quest::settimer("start_storm",1);
}
sub EVENT_COMBAT {
if ($combat_state == 1) {
$client = $userid;
}
}
sub EVENT_TIMER {
if ($timer eq "start_storm") {
quest::stoptimer("start_storm");
quest::npctexture(3);
quest::settimer("change_storm1",5); }
if ($timer eq "change_storm1") {
quest::stoptimer("change_storm1");
quest::npctexture(2);
quest::emote("gains more energy and becomes less stable.");
quest::settimer("change_storm2",5); }
if ($timer eq "change_storm2") {
quest::stoptimer("change_storm2");
quest::npctexture(1);
quest::emote("gains even more energy and looks extremely dangerous.");
quest::settimer("change_storm3",5); }
if ($timer eq "change_storm3") {
quest::stoptimer("change_storm3");
$npc->castSpell($client,6536);
quest::emote("explodes and disperses.");
quest::depop(); }
}