本文整理汇总了C++中GetSpellStore函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSpellStore函数的具体用法?C++ GetSpellStore怎么用?C++ GetSpellStore使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetSpellStore函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleLearnAllGMCommand
static bool HandleLearnAllGMCommand(ChatHandler* handler, const char* /*args*/)
{
for (uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i)
{
SpellEntry const* spellInfo = sSpellStore.LookupEntry(i);
if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer(), false))
continue;
if (!sSpellMgr->IsSkillTypeSpell(i, SKILL_INTERNAL))
continue;
handler->GetSession()->GetPlayer()->learnSpell(i, false);
}
handler->SendSysMessage(LANG_LEARNING_GM_SKILLS);
return true;
}
示例2: boss_netherspiteAI
boss_netherspiteAI(Creature* c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
for (int i=0; i<3; ++i)
{
PortalGUID[i] = 0;
BeamTarget[i] = 0;
BeamerGUID[i] = 0;
}
// need core fix
for (int i=0; i<3; ++i)
{
if (SpellEntry *spell = (SpellEntry*)GetSpellStore()->LookupEntry(PlayerBuff[i]))
spell->AttributesEx |= SPELL_ATTR_EX_NEGATIVE;
}
}
示例3: ItemUse_item_petrov_cluster_bombs
bool ItemUse_item_petrov_cluster_bombs(Player* pPlayer, Item* pItem, const SpellCastTargets &pTargets)
{
if (pPlayer->GetZoneId() != ZONE_ID_HOWLING)
return false;
if (!pPlayer->GetTransport() || pPlayer->GetAreaId() != AREA_ID_SHATTERED_STRAITS)
{
pPlayer->SendEquipError(EQUIP_ERR_NONE, pItem, NULL);
if (const SpellEntry* pSpellInfo = GetSpellStore()->LookupEntry(SPELL_PETROV_BOMB))
Spell::SendCastResult(pPlayer, pSpellInfo, 1, SPELL_FAILED_NOT_HERE);
return true;
}
return false;
}
示例4: _DoCastSpellIfCan
CanCastResult BossSpellWorker::_DoCastSpellIfCan(Unit* pTarget, uint32 uiSpell, uint32 uiCastFlags, uint64 uiOriginalCasterGUID)
{
Unit* pCaster = boss;
if (!pTarget) return CAST_FAIL_OTHER;
if (uiCastFlags & CAST_FORCE_TARGET_SELF)
pCaster = pTarget;
// Allowed to cast only if not casting (unless we interrupt ourself) or if spell is triggered
if (!pCaster->IsNonMeleeSpellCasted(false) || (uiCastFlags & (CAST_TRIGGERED | CAST_INTERRUPT_PREVIOUS)))
{
if (const SpellEntry* pSpell = GetSpellStore()->LookupEntry(uiSpell))
{
// If cast flag CAST_AURA_NOT_PRESENT is active, check if target already has aura on them
if (uiCastFlags & CAST_AURA_NOT_PRESENT)
{
if (pTarget->HasAura(uiSpell))
return CAST_FAIL_TARGET_AURA;
}
// Check if cannot cast spell
if (!(uiCastFlags & (CAST_FORCE_TARGET_SELF | CAST_FORCE_CAST)))
{
CanCastResult castResult = _CanCastSpell(pTarget, pSpell, uiCastFlags & CAST_TRIGGERED);
if (castResult != CAST_OK)
return castResult;
}
// Interrupt any previous spell
if (uiCastFlags & CAST_INTERRUPT_PREVIOUS && pCaster->IsNonMeleeSpellCasted(false))
pCaster->InterruptNonMeleeSpells(false);
pCaster->CastSpell(pTarget, pSpell, uiCastFlags & CAST_TRIGGERED, NULL, NULL, uiOriginalCasterGUID);
return CAST_OK;
}
else
{
error_log("BSW: DoCastSpellIfCan by creature entry %u attempt to cast spell %u but spell does not exist.", boss->GetEntry(), uiSpell);
return CAST_FAIL_OTHER;
}
}
else
return CAST_FAIL_IS_CASTING;
}
示例5: boss_nalorakkAI
boss_nalorakkAI(Creature *c) : ScriptedAI(c)
{
MoveEvent = true;
MovePhase = 0;
pInstance = (c->GetInstanceData());
SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_MANGLE);
if(TempSpell)
{
TempSpell->EffectImplicitTargetA[1] = TARGET_UNIT_TARGET_ENEMY;
}
wLoc.coord_x = NalorakkWay[7][0];
wLoc.coord_y = NalorakkWay[7][1];
wLoc.coord_z = NalorakkWay[7][2];
wLoc.orientation = 0;
wLoc.mapid = m_creature->GetMapId();
m_creature->setActive(true);
}
示例6: ItemUse_item_Capteur_Tellurique
bool ItemUse_item_Capteur_Tellurique(Player* pPlayer, Item* pItem, const SpellCastTargets &pTargets)
{
if(pPlayer->GetAreaId() == 4157)
{
if(pPlayer->GetPositionZ() < 185.0f)
{
pPlayer->TeleportTo(pPlayer->GetMapId(),3329.524f,2543.395f,197.317f,4.950f);
pPlayer->KilledMonsterCredit(27853,0);
}
else
pPlayer->TeleportTo(pPlayer->GetMapId(),3414.0f,2363.01f,37.911f,3.102f);
}
else
{
Spell::SendCastResult(pPlayer, GetSpellStore()->LookupEntry(47097), 1, SPELL_FAILED_INCORRECT_AREA);
return false;
}
return true;
}
示例7: EnfeebleHealthEffect
void EnfeebleHealthEffect()
{
const SpellEntry *info = GetSpellStore()->LookupEntry(SPELL_ENFEEBLE_EFFECT);
if (!info)
return;
ThreatList const& tList = m_creature->getThreatManager().getThreatList();
std::vector<Unit *> targets;
if (tList.empty())
return;
//begin + 1 , so we don't target the one with the highest threat
ThreatList::const_iterator itr = tList.begin();
std::advance(itr, 1);
for(; itr!= tList.end(); ++itr) //store the threat list in a different container
{
Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
//only on alive players
if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
targets.push_back(target);
}
//cut down to size if we have more than 5 targets
while(targets.size() > 5)
targets.erase(targets.begin()+rand()%targets.size());
int i = 0;
for(std::vector<Unit *>::iterator iter = targets.begin(); iter!= targets.end(); ++iter, ++i)
{
Unit *target = *iter;
if (target)
{
enfeeble_targets[i] = target->GetGUID();
enfeeble_health[i] = target->GetHealth();
target->CastSpell(target, SPELL_ENFEEBLE, true, 0, 0, m_creature->GetGUID());
target->SetHealth(1);
}
}
}
示例8: GOGossipSelect_go_ulduar_teleporter
bool GOGossipSelect_go_ulduar_teleporter(Player *pPlayer, GameObject* pGo, uint32 sender, uint32 action)
{
int32 damage = 0;
if(sender != GOSSIP_SENDER_MAIN) return false;
if(!pPlayer->getAttackers().empty()) return false;
if(action >= 0 && action <= PORTALS_COUNT)
pPlayer->TeleportTo(PortalLoc[action].map_num, PortalLoc[action].x, PortalLoc[action].y, PortalLoc[action].z, PortalLoc[action].o);
if (PortalLoc[action].spellID != 0 )
if (SpellEntry const* spell = (SpellEntry *)GetSpellStore()->LookupEntry(PortalLoc[action].spellID))
{
SpellAuraHolder *holder = CreateSpellAuraHolder(spell, pPlayer, pPlayer);
Aura *aura = CreateAura(spell, EFFECT_INDEX_2, NULL, holder, pPlayer);
holder->AddAura(aura, EFFECT_INDEX_2);
}
pPlayer->CLOSE_GOSSIP_MENU();
return true;
}
示例9: GetSpellStore
bool PlayerbotClassAI::castDispel (uint32 dispelSpell, Unit *dTarget, bool checkFirst, bool castExistingAura, bool skipFriendlyCheck, bool skipEquipStanceCheck)
{
if (dispelSpell == 0 || !dTarget ) return false;
//if (!canCast(dispelSpell, dTarget, true)) return false; //Needless cpu cycles wasted, usually a playerbot can cast a dispell
const SpellEntry *dSpell = GetSpellStore()->LookupEntry(dispelSpell);
if (!dSpell) return false;
for (uint8 i = 0 ; i < MAX_SPELL_EFFECTS ; ++i)
{
if (dSpell->Effect[i] != (uint32)SPELL_EFFECT_DISPEL) continue;
uint32 dispel_type = dSpell->EffectMiscValue[i];
uint32 dispelMask = GetDispellMask(DispelType(dispel_type));
Unit::AuraMap const& auras = dTarget->GetOwnedAuras();
for (Unit::AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); itr++)
{
Aura * aura = itr->second;
AuraApplication * aurApp = aura->GetApplicationOfTarget(dTarget->GetGUID());
if (!aurApp)
continue;
if ((1<<aura->GetSpellProto()->Dispel) & dispelMask)
{
if(aura->GetSpellProto()->Dispel == DISPEL_MAGIC)
{
bool positive = aurApp->IsPositive() ? (!(aura->GetSpellProto()->AttributesEx & SPELL_ATTR0_UNK7)) : false;
// do not remove positive auras if friendly target
// negative auras if non-friendly target
if(positive == dTarget->IsFriendlyTo(GetPlayerBot()))
continue;
}
// If there is a successfull match return, else continue searching.
if (CastSpell(dSpell, dTarget, checkFirst, castExistingAura, skipFriendlyCheck, skipEquipStanceCheck)) {
return true;
}
}
}
}
return false;
}
示例10: CastDoom
void CastDoom()
{
SpellEntry *spellInfo = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_DOOM);
if (spellInfo)
//target without tank
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1))
{
if (pTarget->GetTypeId() == TYPEID_PLAYER)
{
for(uint8 i=0; i< MAX_EFFECT_INDEX; ++i)
{
uint8 eff = spellInfo->Effect[SpellEffectIndex(i)];
if (eff >= TOTAL_SPELL_EFFECTS)
continue;
//uint8 i=1;
/*pTarget->AddAura(new AzgalorDoom(spellInfo, SpellEffectIndex(i), NULL, pTarget, pTarget));*/
}
}
else
DoomTimer = 1000;
}
}
示例11: CastMark
void CastMark()
{
SpellEntry *spellInfo = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_MARK);
if (spellInfo)
{
std::list<HostileReference *> t_list = m_creature->getThreatManager().getThreatList();
for(std::list<HostileReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
Unit *target = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid());
if (target && target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() == POWER_MANA)
{
for(uint32 i=0; i < MAX_EFFECT_INDEX; ++i)
{
uint8 eff = spellInfo->Effect[SpellEffectIndex(i)];
if (eff >= TOTAL_SPELL_EFFECTS)
continue;
/*target->AddAura(new KazrogalMark(spellInfo, SpellEffectIndex(i), NULL, target, target));*/
}
}
}
}
}
示例12: EnfeebleHealthEffect
void EnfeebleHealthEffect() {
const SpellEntry *info = GetSpellStore()->LookupEntry(
SPELL_ENFEEBLE_EFFECT);
if (!info)
return;
std::list<HostileReference *> t_list =
me->getThreatManager().getThreatList();
std::vector<Unit *> targets;
if (!t_list.size())
return;
//begin + 1, so we don't target the one with the highest threat
std::list<HostileReference *>::const_iterator itr = t_list.begin();
std::advance(itr, 1);
for (; itr != t_list.end(); ++itr) //store the threat list in a different container
if (Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
if (pTarget->isAlive()
&& pTarget->GetTypeId() == TYPEID_PLAYER)
targets.push_back(pTarget);
//cut down to size if we have more than 5 targets
while (targets.size() > 5)
targets.erase(targets.begin() + rand() % targets.size());
uint32 i = 0;
for (std::vector<Unit *>::const_iterator iter = targets.begin();
iter != targets.end(); ++iter, ++i)
if (Unit *pTarget = *iter) {
enfeeble_targets[i] = pTarget->GetGUID();
enfeeble_health[i] = pTarget->GetHealth();
pTarget->CastSpell(pTarget, SPELL_ENFEEBLE, true, 0, 0,
me->GetGUID());
pTarget->SetHealth(1);
}
}
示例13: error_log
bool BSWScriptedAI::_doAura(uint8 m_uiSpellIdx, Unit* pTarget, SpellEffectIndex index)
{
SpellTable* pSpell = &m_BossSpell[m_uiSpellIdx];
if (!pTarget || !pTarget->IsInMap(m_creature) || !pTarget->isAlive())
{
error_log("BSW: FAILED adding aura of spell number %u - no target or target not in map or target is dead",pSpell->m_uiSpellEntry[currentDifficulty]);
return false;
}
if (_hasAura(m_uiSpellIdx,pTarget))
debug_log("BSW: adding aura stack from spell %u index %u",pSpell->m_uiSpellEntry[currentDifficulty], index);
else debug_log("BSW: adding new aura from spell %u index %u",pSpell->m_uiSpellEntry[currentDifficulty], index);
SpellEntry const *spell = (SpellEntry *)GetSpellStore()->LookupEntry(pSpell->m_uiSpellEntry[currentDifficulty]);
if (spell && spell->Effect[index] < TOTAL_SPELL_EFFECTS)
{
if (IsSpellAppliesAura(spell, (1 << EFFECT_INDEX_0) | (1 << EFFECT_INDEX_1) | (1 << EFFECT_INDEX_2)) || IsSpellHaveEffect(spell, SPELL_EFFECT_PERSISTENT_AREA_AURA))
{
SpellAuraHolder *holder = CreateSpellAuraHolder(spell, pTarget, pTarget);
int32 basepoint = pSpell->varData ? pSpell->varData - 1 : spell->EffectBasePoints[index] + 1;
if ( IsAreaAuraEffect(spell->Effect[index]) ||
spell->Effect[index] == SPELL_EFFECT_APPLY_AURA ||
spell->Effect[index] == SPELL_EFFECT_PERSISTENT_AREA_AURA )
{
Aura *aura = CreateAura(spell, SpellEffectIndex(index), &basepoint, holder, pTarget);
holder->AddAura(aura, SpellEffectIndex(index));
return true;
}
}
}
error_log("BSW: FAILED adding aura from spell %u index %u",pSpell->m_uiSpellEntry[currentDifficulty], index);
return false;
};
示例14: DoWorkaroundForQuestCredit
// some targeting issues with the spell, so use this workaround as temporary solution
void DoWorkaroundForQuestCredit() {
Map* pMap = me->GetMap();
if (!pMap || pMap->IsHeroic())
return;
Map::PlayerList const &lList = pMap->GetPlayers();
if (lList.isEmpty())
return;
SpellEntry const* pSpell = GetSpellStore()->LookupEntry(
SPELL_ORB_KILL_CREDIT);
for (Map::PlayerList::const_iterator i = lList.begin();
i != lList.end(); ++i) {
if (Player* pPlayer = i->getSource()) {
if (pSpell && pSpell->EffectMiscValue[0])
pPlayer->KilledMonsterCredit(pSpell->EffectMiscValue[0],
0);
}
}
}
示例15: UpdateAI
void UpdateAI(const uint32 diff)
{
if(!me->IsNonMeleeSpellCasted(false) && !me->isInCombat())
{
if(OOCTimer < diff)
{
HandleOffCombatEffects();
OOCTimer = 10000;
}
else
OOCTimer -= diff;
}
if(!UpdateVictim())
return;
if(Frostbolt_Timer < diff)
{
AddSpellToCast(me->getVictim(), SPELL_FROSTBOLT);
Frostbolt_Timer = SpellMgr::GetSpellCastTime(GetSpellStore()->LookupEntry(SPELL_FROSTBOLT))-(diff+100);
}
else
Frostbolt_Timer -= diff;
if(Arcane_Nova_Timer < diff)
{
ClearCastQueue();
AddSpellToCast(SPELL_ARCANE_NOVA, CAST_SELF);
Arcane_Nova_Timer = urand(16000, 20000);
}
else
Arcane_Nova_Timer -= diff;
CheckCasterNoMovementInRange(diff, 35.0);
CastNextSpellIfAnyAndReady();
DoMeleeAttackIfReady();
}