本文整理汇总了C++中IsValidSpell函数的典型用法代码示例。如果您正苦于以下问题:C++ IsValidSpell函数的具体用法?C++ IsValidSpell怎么用?C++ IsValidSpell使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsValidSpell函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsSuspendableSpell
bool IsSuspendableSpell(uint16 spell_id)
{
if (IsValidSpell(spell_id) && spells[spell_id].suspendable)
return true;
return false;
}
示例2: handle_player_death
void handle_player_death(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Seperator sep(data.c_str());
Mob *o = entity_list.GetMobID(std::stoi(sep.arg[0]));
Lua_Mob l_mob(o);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "other");
lua_pushinteger(L, std::stoi(sep.arg[1]));
lua_setfield(L, -2, "damage");
int spell_id = std::stoi(sep.arg[2]);
if(IsValidSpell(spell_id)) {
Lua_Spell l_spell(&spells[spell_id]);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
} else {
Lua_Spell l_spell(nullptr);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
}
lua_pushinteger(L, std::stoi(sep.arg[3]));
lua_setfield(L, -2, "skill");
}
示例3: IsBuffSpell
// returns true for both detrimental and beneficial buffs
bool IsBuffSpell(uint16 spell_id)
{
if (IsValidSpell(spell_id) && (spells[spell_id].buffduration || spells[spell_id].buffdurationformula))
return true;
return false;
}
示例4: DetrimentalSpellAllowsRest
bool DetrimentalSpellAllowsRest(uint16 spell_id)
{
if (IsValidSpell(spell_id))
return spells[spell_id].AllowRest;
return false;
}
示例5: GetDamageShieldType
DmgShieldType GetDamageShieldType(uint16 spell_id, int32 DSType)
{
// If we have a DamageShieldType for this spell from the damageshieldtypes table, return that,
// else, make a guess, based on the resist type. Default return value is DS_THORNS
if (IsValidSpell(spell_id)) {
_log(SPELLS__EFFECT_VALUES, "DamageShieldType for spell %i (%s) is %X\n", spell_id,
spells[spell_id].name, spells[spell_id].DamageShieldType);
if (spells[spell_id].DamageShieldType)
return (DmgShieldType) spells[spell_id].DamageShieldType;
switch (spells[spell_id].resisttype) {
case RESIST_COLD:
return DS_TORMENT;
case RESIST_FIRE:
return DS_BURN;
case RESIST_DISEASE:
return DS_DECAY;
default:
return DS_THORNS;
}
}
else if (DSType)
return (DmgShieldType) DSType;
return DS_THORNS;
}
示例6: IsBardSong
bool IsBardSong(uint16 spell_id)
{
if (IsValidSpell(spell_id) && spells[spell_id].classes[BARD - 1] < 255)
return true;
return false;
}
示例7: IsPersistDeathSpell
bool IsPersistDeathSpell(uint16 spell_id)
{
if (IsValidSpell(spell_id) && spells[spell_id].persistdeath)
return true;
return false;
}
示例8: GetFuriousBash
int32 GetFuriousBash(uint16 spell_id)
{
if(!IsValidSpell(spell_id))
return 0;
bool found_effect_limit = false;
int32 mod = 0;
for(int i = 0; i < EFFECT_COUNT; ++i)
{
if(spells[spell_id].effectid[i] == SE_SpellHateMod)
{
mod = spells[spell_id].base[i];
}
else if(spells[spell_id].effectid[i] == SE_LimitEffect)
{
if(spells[spell_id].base[i] == 999)
{
found_effect_limit = true;
}
}
}
if(found_effect_limit)
return mod;
else
return 0;
}
示例9: IsTargetableAESpell
bool IsTargetableAESpell(uint16 spell_id)
{
if (IsValidSpell(spell_id) && spells[spell_id].targettype == ST_AETarget)
return true;
return false;
}
示例10: IsBeneficialSpell
bool IsBeneficialSpell(uint16 spell_id)
{
if(!IsValidSpell(spell_id))
return false;
if(spells[spell_id].goodEffect == 1){
SpellTargetType tt = spells[spell_id].targettype;
if(tt != ST_Self && tt != ST_Pet){
if(IsEffectInSpell(spell_id, SE_CancelMagic))
return false;
}
if(tt == ST_Target || tt == ST_AETarget || tt == ST_Animal || tt == ST_Undead || tt == ST_Pet) {
uint16 sai = spells[spell_id].SpellAffectIndex;
if(spells[spell_id].resisttype == RESIST_MAGIC){
if(sai == SAI_Calm || sai == SAI_Dispell_Sight || sai == SAI_Memory_Blur || sai == SAI_Calm_Song)
return false;
}else{
// Bind Sight and Cast Sight
if(sai == SAI_Dispell_Sight && spells[spell_id].skill == 18 && !IsEffectInSpell(spell_id, SE_VoiceGraft))
return false;
}
}
}
return spells[spell_id].goodEffect != 0 || IsGroupSpell(spell_id);
}
示例11: handle_npc_death
void handle_npc_death(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_Mob l_mob(init);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "other");
Seperator sep(data.c_str());
lua_pushinteger(L, std::stoi(sep.arg[0]));
lua_setfield(L, -2, "damage");
int spell_id = std::stoi(sep.arg[1]);
if(IsValidSpell(spell_id)) {
Lua_Spell l_spell(&spells[spell_id]);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
} else {
Lua_Spell l_spell(nullptr);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
}
lua_pushinteger(L, std::stoi(sep.arg[2]));
lua_setfield(L, -2, "skill_id");
}
示例12: IsShortDurationBuff
bool IsShortDurationBuff(uint16 spell_id)
{
if (IsValidSpell(spell_id) && spells[spell_id].short_buff_box != 0)
return true;
return false;
}
示例13: GetNimbusEffect
uint32 GetNimbusEffect(uint16 spell_id)
{
if (IsValidSpell(spell_id))
return (int32)spells[spell_id].NimbusEffect;
return 0;
}
示例14: GetSpellEffectDescNum
int GetSpellEffectDescNum(uint16 spell_id)
{
if (IsValidSpell(spell_id))
return spells[spell_id].effectdescnum;
return -1;
}
示例15: IsAERainNukeSpell
bool IsAERainNukeSpell(uint16 spell_id)
{
if (IsValidSpell(spell_id) && IsPureNukeSpell(spell_id) &&
spells[spell_id].aoerange > 0 && spells[spell_id].AEDuration > 1000)
return true;
return false;
}