Code:
int32 buffslot = -1;
switch(id)
{
case 3686: // Speed
buffslot = 0;
break;
case 3687: // Speed (Horde)
buffslot = 1;
break;
case 3706: // Restoration
buffslot = 2;
break;
case 3708: // Restoration (Horde)
buffslot = 3;
break;
case 3707: // Berserking
buffslot = 4;
break;
case 3709: // Berserking (Horde)
buffslot = 5;
break;
}
if(buffslot > 0)
{
if(m_buffs[buffslot] != 0 && m_buffs[buffslot]->IsInWorld())
{
/* apply the buff */
SpellEntry * sp = dbcSpell.LookupEntry(m_buffs[buffslot]->GetInfo()->sound3);
Spell * s = SpellPool.PooledNew();
s->Init(plr, sp, true, 0);
SpellCastTargets targets(plr->GetGUID());
s->prepare(&targets);
/* despawn the gameobject (not delete!) */
m_buffs[buffslot]->Despawn(BUFF_RESPAWN_TIME);
}
return;
}
What I belive is the odd part, is that it gives the buffslot value 0, therefor it wont load and cast the spell on the player. But the question is, what should I change this too? As it seems to have a connection to the DBC files.