Log in

View Full Version : $client->InterruptSpell($spell_id) not stopping spells?


Hateborne
03-26-2016, 01:52 PM
Hello All,

I've run into an issue where $client->InterruptSpell($spell_id) inside of EVENT_CAST or EVENT_CAST_BEGIN does nothing when the spell is cast from an item or from spellbar. The spell is non-instant, cast time of 3 seconds (through item) or spellbar, but it does not stop. I get the interrupted message, but the casting continues until completion.

Any ideas?


-Hate


EDIT: Examples
sub EVENT_CAST_BEGIN
{
my @pogtokens = (11853, 11854, 11855, 11856, 11857, 11858, 11859, 11860, 11861, 11862, 11863, 11864, 11865, 11866, 11867);
if($zonesn ne "airplane" && $spell_id ~~ @pogtokens) { $client->InterruptSpell($spell_id); $client->Message(315, "You cannot use this item outside of the Plane of Gods!"); }
}

sub EVENT_CAST
{
my @pogtokens = (11853, 11854, 11855, 11856, 11857, 11858, 11859, 11860, 11861, 11862, 11863, 11864, 11865, 11866, 11867);
if($zonesn ne "airplane" && $spell_id ~~ @pogtokens) { $client->InterruptSpell($spell_id); $client->Message(315, "You cannot use this item outside of the Plane of Gods!"); }
}

Hateborne
03-26-2016, 01:59 PM
Update: $client->Duck() is a ghetto workaround.


-Hate

Kingly_Krab
03-26-2016, 10:05 PM
Just add a blocked_spells entry for all these spells or something.

Hateborne
03-26-2016, 10:45 PM
Just add a blocked_spells entry for all these spells or something.

I would like to be able to disable spells, except when the appropriate zone. The items are click effects on items to summon creatures. Right now, if $zonesn not equal to 'airplane', it forces an interrupt via duck.

Even so, does anyone else have experience with it work/not-working? :-)


-Hate

N0ctrnl
03-26-2016, 11:03 PM
As another option, you could just have a blank spell that triggers a quest script. Then you can check for the zone or whatever you want before even allowing the spell to trigger.

Kayen
03-29-2016, 06:58 AM
$client->Stun(1)

Hateborne
03-29-2016, 03:25 PM
$client->Stun(1)

Also does not stop casting Kayen.


-Hate

NatedogEZ
03-29-2016, 04:51 PM
sub EVENT_CAST_BEGIN {
quest::settimer("stopcast", 1);

}

sub EVENT_TIMER {
if ($timer eq "stopcast") {
$client->InterruptSpell();
$client->Message(335, "Stop casting..");
quest::stoptimer("stopcast");
}
}


One way to get it to work.. but shorter spell cast times might be an issue :p