本文整理汇总了C++中GetTalentSpellPos函数的典型用法代码示例。如果您正苦于以下问题:C++ GetTalentSpellPos函数的具体用法?C++ GetTalentSpellPos怎么用?C++ GetTalentSpellPos使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetTalentSpellPos函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTalentSpellCost
uint32 GetTalentSpellCost(uint32 spellId)
{
if(TalentSpellPos const* pos = GetTalentSpellPos(spellId))
return pos->rank+1;
return 0;
}
示例2: GetTalentSpellPos
int AiFactory::GetPlayerSpecTab(Player* player)
{
int c0 = 0, c1 = 0, c2 = 0;
PlayerTalentMap& talentMap = player->GetTalentMap(0);
for (PlayerTalentMap::iterator i = talentMap.begin(); i != talentMap.end(); ++i)
{
uint32 spellId = i->first;
TalentSpellPos const* talentPos = GetTalentSpellPos(spellId);
if(!talentPos)
continue;
TalentEntry const* talentInfo = sTalentStore.LookupEntry(talentPos->talent_id);
if (!talentInfo)
continue;
uint32 const* talentTabIds = GetTalentTabPages(player->getClass());
if (talentInfo->TalentTab == talentTabIds[0]) c0++;
if (talentInfo->TalentTab == talentTabIds[1]) c1++;
if (talentInfo->TalentTab == talentTabIds[2]) c2++;
}
if (c0 >= c1 && c0 >= c2)
return 0;
if (c1 >= c0 && c1 >= c2)
return 1;
return 2;
}
示例3: SpellCheck
bool CharacterDatabaseCleaner::SpellCheck(uint32 spell_id) {
return sSpellStore.LookupEntry(spell_id) && !GetTalentSpellPos(spell_id);
}
示例4: GetTalentSpellCost
uint32 GetTalentSpellCost(uint32 spellId)
{
return GetTalentSpellCost(GetTalentSpellPos(spellId));
}
示例5: SpellCheck
bool CharacterDatabaseCleaner::SpellCheck(uint32 spell_id)
{
return sSpellMgr->GetSpellInfo(spell_id) && !GetTalentSpellPos(spell_id);
}
示例6: LearnSpellsForNewLevel
void LearnSpellsForNewLevel(Player* player, uint8 level)
{
if (level == player->getLevel() + 1)
return;
uint32 family;
switch(player->getClass())
{
case CLASS_ROGUE:
family = SPELLFAMILY_ROGUE;
break;
case CLASS_DEATH_KNIGHT:
family = SPELLFAMILY_DEATHKNIGHT;
break;
case CLASS_WARRIOR:
family = SPELLFAMILY_WARRIOR;
break;
case CLASS_PRIEST:
family = SPELLFAMILY_PRIEST;
break;
case CLASS_MAGE:
family = SPELLFAMILY_MAGE;
break;
case CLASS_PALADIN:
family = SPELLFAMILY_PALADIN;
break;
case CLASS_HUNTER:
family = SPELLFAMILY_HUNTER;
break;
case CLASS_DRUID:
family = SPELLFAMILY_DRUID;
break;
case CLASS_SHAMAN:
family = SPELLFAMILY_SHAMAN;
break;
case CLASS_WARLOCK:
family = SPELLFAMILY_WARLOCK;
break;
}
for (uint32 i = 0; i < sSpellMgr->GetSpellInfoStoreSize(); ++i)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(i);
if (!spellInfo)
continue;
if (spellInfo->SpellFamilyName != family)
continue;
if (IsIgnoredSpell(spellInfo->Id))
continue;
if (spellInfo->PowerType == POWER_FOCUS)
continue;
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, spellInfo->Id, player))
continue;
if ((spellInfo->AttributesEx7 & SPELL_ATTR7_ALLIANCE_ONLY && player->GetTeam() != ALLIANCE) || (spellInfo->AttributesEx7 & SPELL_ATTR7_HORDE_ONLY && player->GetTeam() != HORDE))
continue;
if (spellInfo->BaseLevel != level && sSpellMgr->IsSpellValid(spellInfo, player))
continue;
bool valid = false;
SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellInfo->Id);
for (SkillLineAbilityMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
{
if (itr->second->spellId == spellInfo->Id && itr->second->racemask == 0 && itr->second->learnOnGetSkill == 0)
{
valid = true;
SpellInfo const* prevSpell = spellInfo->GetPrevRankSpell();
if (prevSpell && !player->HasSpell(prevSpell->Id))
{
valid = false;
break;
}
if (GetTalentSpellPos(itr->second->spellId))
if (!prevSpell || !player->HasSpell(prevSpell->Id) || spellInfo->GetRank() == 1)
valid = false;
break;
}
}
if (valid)
player->learnSpell(spellInfo->Id, false);
}
LearnSpellsForNewLevel(player, ++level);
}