Hello, I am French and I have certainly not an English as good as yours. but let
Here I have coding variants at the entrance of icc. But when I activate the 10% buff it appears everything is good, and when I activate the buff 15%, the 10% buff does not disappear.
What is the solution please?
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "Player.h"
enum Spells
{
//Buff alliance
spell_force_5 = 73762,
spell_force10 = 73824,
spell_force15 = 73825,
spell_force20 = 73826,
spell_force25 = 73827,
spell_force30 = 73828,
//Buff horde
spell_chant_5 = 73816,
spell_chant_10 = 73818,
spell_chant_15 = 73819,
spell_chant_20 = 73820,
spell_chant_25 = 73821,
spell_chant_30 = 73822,
};
class npc_varian : public CreatureScript
{
public:
npc_varian(): CreatureScript("npc_varian"){ }
struct npc_varianAI: public ScriptedAI
{
npc_varianAI(Creature* creature) : ScriptedAI(creature) { }
void sGossipSelect(Player* player, uint32 /*sender*/, uint32 action) OVERRIDE
{
if (action == 2)
{
player->CLOSE_GOSSIP_MENU();
player->InterruptNonMeleeSpells(false);
player->CastSpell(player, spell_force_5);
}
if (action == 3)
{
player->CLOSE_GOSSIP_MENU();
player->InterruptNonMeleeSpells(false);
player->CastSpell(player, spell_force10);
}
if (action == 4)
{
player->CLOSE_GOSSIP_MENU();
player->InterruptNonMeleeSpells(false);
player->CastSpell(player, spell_force15);
}
if (action == 5)
{
player->CLOSE_GOSSIP_MENU();
player->InterruptNonMeleeSpells(false);
player->CastSpell(player, spell_force20);
}
if (action == 6)
{
player->CLOSE_GOSSIP_MENU();
player->InterruptNonMeleeSpells(false);
player->CastSpell(player, spell_force25);
}
if (action == 7)
{
player->CLOSE_GOSSIP_MENU();
player->InterruptNonMeleeSpells(false);
player->CastSpell(player, spell_force30);
}
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_varianAI(creature);
}
};
void AddSC_buff_icc()
{
new npc_varian();
}