Cancel Spell

Hello, i have boss that casts spell ,that lasts forever (this spell: http://www.wowhead.com/spell=106062/water-bubble).

How can i make the boss stop cast this spell with script? I already tried with

WorldPackets::Spells::CancelAura(106062);but when the boss comes to this phase the worldserver crashes.

Bump?:smiley:

Notice the last row:

http://i.imgur.com/jXZ1CFI.png

Notice the last row:

http://i.imgur.com/jXZ1CFI.png

​Okay, here is all of my code:

#include “ScriptPCH.h”
#include <SpellPackets.h>
#include <TaskScheduler.h>
int living_waters_left = 1;
enum Spells
{
SPELL_CALL_WATER = 106526,
SPELL_WATER_BUBBLE = 106062,
SPELL_SHA_RESIDUE = 106653,
SPELL_WASH_AWAY = 106331,
};

enum Events
{
EVENT_CALL_WATER = 1,
EVENT_SHA_RESIDUE = 2,
EVENT_WASH_AWAY = 3,
};

class wise_mari : public CreatureScript
{
public:
wise_mari() : CreatureScript(“wise_mari”) { }

    struct wise_mariAI : public BossAI
    {
        wise_mariAI(Creature* creature) : BossAI(creature, 0)
        {
        }

    

        void Reset() override
        {
            _Reset();
	living_waters_left = 1;
        }
		
        void EnterCombat(Unit* /*who*/) override
        {
	Talk(0);
	DoCastVictim(SPELL_WATER_BUBBLE);
	events.ScheduleEvent(EVENT_CALL_WATER, 10000);
        }
		
        void KilledUnit(Unit * /*victim*/) override
        {
	int killsound = rand() % 3 + 2;
	Talk(killsound);
        }
		
        void JustDied(Unit * /*victim*/) override
        {
	Talk(1);
        }

        void UpdateAI(uint32 diff) override
        {
            if (!UpdateVictim())
                return;
				
            events.Update(diff);

            if (me->HasUnitState(UNIT_STATE_CASTING))
                return;
				
            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    default:
                        break;
		case EVENT_CALL_WATER:
		    if (living_waters_left <= 4)
		    {
		    living_waters_left++;
		    DoCastVictim(SPELL_CALL_WATER);
		    events.ScheduleEvent(EVENT_CALL_WATER, 15000);
		    Talk(6); 
		    }
		    else if (living_waters_left > 4)
		    {
		    WorldPackets::Spells::CancelAura(106062);
		    events.ScheduleEvent(EVENT_WASH_AWAY, 6000);
		    }
		    break;
		case EVENT_WASH_AWAY:
		    DoCastVictim(SPELL_WASH_AWAY);
                        break;
                }
            }
			
            DoMeleeAttackIfReady();
        }
    };

    CreatureAI* GetAI(Creature* creature) const override
    {
        return new wise_mariAI(creature);
    }

};
class corrupt_living_water : public CreatureScript
{
public:
corrupt_living_water() : CreatureScript(“corrupt_living_water”) { }

    struct corrupt_living_waterAI : public BossAI
    {
        corrupt_living_waterAI(Creature* creature) : BossAI(creature, 0)
        {
        }

    

        void Reset() override
        {
            _Reset();
        }
		
        void EnterCombat(Unit* /*who*/) override
        {
	events.ScheduleEvent(EVENT_SHA_RESIDUE, 1);
        }
		
        void KilledUnit(Unit * /*victim*/) override
        {
	
        }
		
        void JustDied(Unit * /*victim*/) override
        {
	
        }

        void UpdateAI(uint32 diff) override
        {
            if (!UpdateVictim())
                return;
				
            events.Update(diff);

            if (me->HasUnitState(UNIT_STATE_CASTING))
                return;
				
            while (uint32 eventId = events.ExecuteEvent())
            {
                switch (eventId)
                {
                    default:
                        break;
		case EVENT_SHA_RESIDUE:
		    DoCastVictim(SPELL_SHA_RESIDUE);
		    break;
                }
            }
			
            DoMeleeAttackIfReady();
        }
    };

    CreatureAI* GetAI(Creature* creature) const override
    {
        return new corrupt_living_waterAI(creature);
    }

};

void AddSC_wise_mari()
{
new wise_mari();
new corrupt_living_water();
}
The crash comes when the npc do this line:

WorldPackets::Spells::CancelAura(106062);
Anyway ty for response, Aokromes.

Guys…Im sure there is way to do that.

who are you trying to remove the aura from?
me->RemoveAura(spellid);

is it really an aura?

who are you trying to remove the aura from?
me->RemoveAura(spellid);

is it really an aura?

​I am trying to remove Water Bubble spell(http://www.wowhead.com/spell=106062/water-bubble) from Wise Mari boss(http://www.wowhead.com/npc=56448/wise-mari). Im not sure if this spell is aura.

Problem solved :). Ty, rochet.