Ok so the idea of it is; you have your weapon, when you kill someone with the weapon it adds a stackable permenant aura, once it stacks 500 times, it casts a spell to delete your current weapon and create a new one. Now I can do the spell side of it easy enough, so lets presume I have the spells already made, I just need the script to peice them all together. So how does this look so far, where have I gone wrong and how would I make it so the new weapon is automatically equipped?
Code:
case 98000: // Spell: Weapon
{
if (!victim || !victim->isDead()) // When victim is dead
CastSpell(this, 98001, true, NULL, triggeredByAura); // Spell: Soul Claimed
// this can't be handled in AuraScript because we need to know victim
Aura const* dummy = GetAura(98001); //Aura: Soul Claimed
if (!dummy || dummy->GetStackAmount() < 500) // If less than 500 kills then do nothing
return false;
RemoveAurasDueToSpell(98001); // Otherwise remove aura
triggered_spell_id = 98002 & 98003; // Then cast Spell: delete old weapon & cast Spell: create new weapon
target = player;
break;
}