Hello, I’m quite new to TrinityCore and im trying to make some kind of check which should block players from casting harmful spell onto thier own faction, or friendly players in general.
I’m familair with OregonCore, which is an old 2.4.3 Fork of Trinity and i’ve used this for a long long time without any problems in “CanCast()”.
[CODE] if(!IsPositiveSpell(m_spellInfo->Id) && !m_IsTriggeredSpell
&& m_caster->GetTypeId() == TYPEID_PLAYER && m_caster != target && !m_caster->canAttack(target))
{
// anti faction hack
return SPELL_FAILED_BAD_TARGETS;
}[/CODE]
I tried this on trinity with an error message instead of a return to start with, and I got spammed by loads of them(all random spells), so i’m missing something. Any idea’s?
ps. This IS blizzlike, you cant “factionhack” on official realms