AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
SpellClickInfo Struct Reference

#include "ObjectMgr.h"

Public Member Functions

ProfanityNames

Checks NamesProfanity.dbc for reserved names

Parameters
nameName to check for match in NamesProfanity.dbc
Returns
true/false
bool IsFitToRequirements (Unit const *clicker, Unit const *clickee) const
 

Public Attributes

uint32 spellId
 
uint8 castFlags
 
SpellClickUserTypes userType
 

Detailed Description

Member Function Documentation

◆ IsFitToRequirements()

bool SpellClickInfo::IsFitToRequirements ( Unit const *  clicker,
Unit const *  clickee 
) const
319{
320 Player const* playerClicker = clicker->ToPlayer();
321 if (!playerClicker)
322 return true;
323
324 Unit const* summoner = nullptr;
325 // Check summoners for party
326 if (clickee->IsSummon())
327 summoner = clickee->ToTempSummon()->GetSummonerUnit();
328 if (!summoner)
329 summoner = clickee;
330
331 // This only applies to players
332 switch (userType)
333 {
335 if (!playerClicker->IsFriendlyTo(summoner))
336 return false;
337 break;
339 if (!playerClicker->IsInRaidWith(summoner))
340 return false;
341 break;
343 if (!playerClicker->IsInPartyWith(summoner))
344 return false;
345 break;
346 default:
347 break;
348 }
349
350 return true;
351}
@ SPELL_CLICK_USER_PARTY
Definition: SharedDefines.h:684
@ SPELL_CLICK_USER_RAID
Definition: SharedDefines.h:683
@ SPELL_CLICK_USER_FRIEND
Definition: SharedDefines.h:682
Unit * GetSummonerUnit() const
Definition: TemporarySummon.cpp:44
Player * ToPlayer()
Definition: Object.h:195
Definition: Player.h:1056
Definition: Unit.h:1302
TempSummon * ToTempSummon()
Definition: Unit.h:2414
bool IsInRaidWith(Unit const *unit) const
Definition: Unit.cpp:19061
bool IsFriendlyTo(Unit const *unit) const
Definition: Unit.cpp:10249
bool IsInPartyWith(Unit const *unit) const
Definition: Unit.cpp:19038
SpellClickUserTypes userType
Definition: ObjectMgr.h:402

References TempSummon::GetSummonerUnit(), Unit::IsFriendlyTo(), Unit::IsInPartyWith(), Unit::IsInRaidWith(), Unit::IsSummon(), SPELL_CLICK_USER_FRIEND, SPELL_CLICK_USER_PARTY, SPELL_CLICK_USER_RAID, Object::ToPlayer(), Unit::ToTempSummon(), and userType.

Member Data Documentation

◆ castFlags

uint8 SpellClickInfo::castFlags

◆ spellId

uint32 SpellClickInfo::spellId

◆ userType

SpellClickUserTypes SpellClickInfo::userType

Referenced by IsFitToRequirements().