Mathex
Respected Member
Hello I've made a "hack fix" for changing the catform's display id when the aura is applied, somehow it doesn't work, here's the script:
This gives no errors compiling but yeah..
Also added it in the spell_script_names table too
So if anyone knew anything I did wrong it'd be great
--Also willing to know where the morph id for druid forms is called or defined
Code:
#include "ScriptMgr.h"
#include "SpellAuras.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#include "Player.h"
enum Spells
{
SPELL_TRIGGERED = 768
};
class spell_ex_768 : public SpellScriptLoader
{
public:
spell_ex_768() : SpellScriptLoader("spell_ex_768") { }
class spell_ex_768AuraScript : public AuraScript
{
PrepareAuraScript(spell_ex_768AuraScript);
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_TRIGGERED))
return false;
return true;
}
bool Load()
{
if (Unit* caster = GetCaster())
if (caster->GetTypeId() == TYPEID_PLAYER)
return true;
return false;
}
void HandleAfterEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
sLog->outInfo(LOG_FILTER_GENERAL, "Aura Effect has just been applied on target!");
Unit* target = GetTarget();
Player* caster = GetCaster()->ToPlayer();
if (caster->getRace() == RACE_TAUREN)
{
caster->SetDisplayId(43775);
}
if (caster->getRace() == RACE_NIGHTELF)
{
caster->SetDisplayId(43765);
}
}
void Register()
{
AfterEffectApply += AuraEffectApplyFn(spell_ex_768AuraScript::HandleAfterEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
AuraScript* GetAuraScript() const
{
return new spell_ex_768AuraScript();
}
};
void AddSC_DruidHax()
{
new spell_ex_768;
}
This gives no errors compiling but yeah..
Also added it in the spell_script_names table too
So if anyone knew anything I did wrong it'd be great
--Also willing to know where the morph id for druid forms is called or defined
Last edited: