[DiscordArchive] can you build with windows 11 sdk?
[DiscordArchive] can you build with windows 11 sdk?
Archived author: Rencx • Posted: 2024-11-06T12:15:44.016000+00:00
Original source
can you build with windows 11 sdk?
Archived author: blinky • Posted: 2024-11-06T13:01:47.973000+00:00
Original source
Good morning guys. I was wondering if there is someone here more experienced either editing or creating spells. I'm trying to essentially recreate the Omen of Clarity glyph from Wotlk Classic in Azerothcore. I have got as far as creating this but a bit confused how to get it to work or if maybe I'm going about this completely wrong. I also tried looking at spell_druid.cpp but don't even see Faerie Fire in there to maybe just add logic for the clearcasting. ```#include "ScriptMgr.h"
#include "SpellScript.h"
#include "Player.h"
#include "Spell.h"
class spell_faerie_fire_feral : public SpellScriptLoader
{
public:
spell_faerie_fire_feral() : SpellScriptLoader("spell_faerie_fire_feral") { }
class spell_faerie_fire_feral_SpellScript : public SpellScript
{
PrepareSpellScript(spell_faerie_fire_feral_SpellScript);
void HandleOnCast()
{
// Check if the target is an NPC (Unit)
if (Unit* target = GetExplTargetUnit())
{
// Only cast Clearcasting if the target is an NPC
if (target->GetTypeId() == TYPEID_UNIT) // TYPEID_UNIT means NPC
{
if (Unit* caster = GetCaster())
{
// Cast Clearcasting (ID 16870) on the caster
caster->CastSpell(caster, 16870, true);
}
}
}
}
void Register() override
{
OnCast += SpellCastFn(spell_faerie_fire_feral_SpellScript::HandleOnCast);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_faerie_fire_feral_SpellScript();
}
};
// Register the custom script for Faerie Fire (Feral) (ID 16857)
void AddSC_custom_ff()
{
new spell_faerie_fire_feral();
}
```