AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
_SpellScript::EffectNameCheck Class Reference

#include "SpellScript.h"

Inheritance diagram for _SpellScript::EffectNameCheck:
SpellScript::EffectHandler

Public Member Functions

 EffectNameCheck (uint16 _effName)
 
bool Check (SpellInfo const *spellInfo, uint8 effIndex)
 
std::string ToString ()
 

Private Attributes

uint16 effName
 

Detailed Description

Constructor & Destructor Documentation

◆ EffectNameCheck()

_SpellScript::EffectNameCheck::EffectNameCheck ( uint16  _effName)
inline
88{ effName = _effName; }
uint16 effName
Definition: SpellScript.h:92

References effName.

Member Function Documentation

◆ Check()

bool _SpellScript::EffectNameCheck::Check ( SpellInfo const *  spellInfo,
uint8  effIndex 
)
123{
124 if (!spellInfo->Effects[effIndex].Effect && !effName)
125 return true;
126 if (!spellInfo->Effects[effIndex].Effect)
127 return false;
128 return (effName == SPELL_EFFECT_ANY) || (spellInfo->Effects[effIndex].Effect == effName);
129}
#define SPELL_EFFECT_ANY
Definition: SpellScript.h:42

References SpellInfo::Effects, and SPELL_EFFECT_ANY.

Referenced by SpellScript::EffectHandler::CheckEffect().

◆ ToString()

std::string _SpellScript::EffectNameCheck::ToString ( )
132{
133 switch (effName)
134 {
135 case SPELL_EFFECT_ANY:
136 return "SPELL_EFFECT_ANY";
137 default:
138 char num[10];
139 snprintf(num, sizeof(num), "%u", effName);
140 return num;
141 }
142}

References SPELL_EFFECT_ANY.

Referenced by SpellScript::EffectHandler::ToString().

Member Data Documentation

◆ effName

uint16 _SpellScript::EffectNameCheck::effName
private

Referenced by EffectNameCheck().