aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp36
1 files changed, 17 insertions, 19 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index d3da5ceb015..81dc412bb86 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -1628,7 +1628,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype)
// set the "Crafted by ..." property of the item
if (pItem->GetTemplate()->Class != ITEM_CLASS_CONSUMABLE && pItem->GetTemplate()->Class != ITEM_CLASS_QUEST && newitemid != 6265 && newitemid != 6948)
- pItem->SetUInt32Value(ITEM_FIELD_CREATOR, player->GetGUIDLow());
+ pItem->SetGuidValue(ITEM_FIELD_CREATOR, player->GetGUID());
// send info to the client
player->SendNewItem(pItem, num_to_add, true, bgType == 0);
@@ -1881,7 +1881,7 @@ void Spell::EffectEnergizePct(SpellEffIndex effIndex)
m_caster->EnergizeBySpell(unitTarget, m_spellInfo->Id, gain, power);
}
-void Spell::SendLoot(uint64 guid, LootType loottype)
+void Spell::SendLoot(ObjectGuid guid, LootType loottype)
{
Player* player = m_caster->ToPlayer();
if (!player)
@@ -1963,7 +1963,7 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex)
Player* player = m_caster->ToPlayer();
uint32 lockId = 0;
- uint64 guid = 0;
+ ObjectGuid guid;
// Get lockId
if (gameObjTarget)
@@ -2106,7 +2106,7 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
m_targets.SetItemTarget(NULL);
m_CastItem = NULL;
- m_castItemGUID = 0;
+ m_castItemGUID.Clear();
m_castItemEntry = 0;
player->StoreItem(dest, pNewItem, true);
@@ -2126,7 +2126,7 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
m_targets.SetItemTarget(NULL);
m_CastItem = NULL;
- m_castItemGUID = 0;
+ m_castItemGUID.Clear();
m_castItemEntry = 0;
player->BankItem(dest, pNewItem, true);
@@ -2150,7 +2150,7 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
m_targets.SetItemTarget(NULL);
m_CastItem = NULL;
- m_castItemGUID = 0;
+ m_castItemGUID.Clear();
m_castItemEntry = 0;
player->EquipItem(dest, pNewItem, true);
@@ -2388,7 +2388,6 @@ void Spell::EffectLearnSpell(SpellEffIndex effIndex)
TC_LOG_DEBUG("spells", "Spell: Player %u has learned spell %u from NpcGUID=%u", player->GetGUIDLow(), spellToLearn, m_caster->GetGUIDLow());
}
-typedef std::list< std::pair<uint32, uint64> > DispelList;
void Spell::EffectDispel(SpellEffIndex effIndex)
{
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
@@ -2578,7 +2577,7 @@ void Spell::EffectUntrainTalents(SpellEffIndex /*effIndex*/)
if (!unitTarget || m_caster->GetTypeId() == TYPEID_PLAYER)
return;
- if (uint64 guid = m_caster->GetGUID()) // the trainer is the caster
+ if (ObjectGuid guid = m_caster->GetGUID()) // the trainer is the caster
unitTarget->ToPlayer()->SendTalentWipeConfirm(guid);
}
@@ -4208,8 +4207,8 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
duel2->isMounted = (GetSpellInfo()->Id == 62875); // Mounted Duel
target->duel = duel2;
- caster->SetUInt64Value(PLAYER_DUEL_ARBITER, pGameObj->GetGUID());
- target->SetUInt64Value(PLAYER_DUEL_ARBITER, pGameObj->GetGUID());
+ caster->SetGuidValue(PLAYER_DUEL_ARBITER, pGameObj->GetGUID());
+ target->SetGuidValue(PLAYER_DUEL_ARBITER, pGameObj->GetGUID());
sScriptMgr->OnPlayerDuelRequest(target, caster);
}
@@ -4485,7 +4484,7 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex)
uint32 go_id = m_spellInfo->Effects[effIndex].MiscValue;
uint8 slot = m_spellInfo->Effects[effIndex].Effect - SPELL_EFFECT_SUMMON_OBJECT_SLOT1;
- if (uint64 guid = m_caster->m_ObjectSlot[slot])
+ if (ObjectGuid guid = m_caster->m_ObjectSlot[slot])
{
if (GameObject* obj = m_caster->GetMap()->GetGameObject(guid))
{
@@ -4494,7 +4493,7 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex)
obj->SetSpellId(0);
m_caster->RemoveGameObject(obj, true);
}
- m_caster->m_ObjectSlot[slot] = 0;
+ m_caster->m_ObjectSlot[slot].Clear();
}
GameObject* go = new GameObject();
@@ -4915,9 +4914,7 @@ void Spell::EffectDispelMechanic(SpellEffIndex effIndex)
return;
uint32 mechanic = m_spellInfo->Effects[effIndex].MiscValue;
-
- std::queue < std::pair < uint32, uint64 > > dispel_list;
-
+ DispelList dispel_list;
Unit::AuraMap const& auras = unitTarget->GetOwnedAuras();
for (Unit::AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
@@ -4926,12 +4923,13 @@ void Spell::EffectDispelMechanic(SpellEffIndex effIndex)
continue;
if (roll_chance_i(aura->CalcDispelChance(unitTarget, !unitTarget->IsFriendlyTo(m_caster))))
if ((aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1 << mechanic)))
- dispel_list.push(std::make_pair(aura->GetId(), aura->GetCasterGUID()));
+ dispel_list.push_back(std::make_pair(aura->GetId(), aura->GetCasterGUID()));
}
- for (; dispel_list.size(); dispel_list.pop())
+ while (!dispel_list.empty())
{
unitTarget->RemoveAura(dispel_list.front().first, dispel_list.front().second, 0, AURA_REMOVE_BY_ENEMY_SPELL);
+ dispel_list.pop_front();
}
}
@@ -5150,7 +5148,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
{
case GAMEOBJECT_TYPE_FISHINGNODE:
{
- m_caster->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, pGameObj->GetGUID());
+ m_caster->SetChannelObjectGuid(pGameObj->GetGUID());
m_caster->AddGameObject(pGameObj); // will removed at spell cancel
// end time of range when possible catch fish (FISHING_BOBBER_READY_TIME..GetDuration(m_spellInfo))
@@ -5433,7 +5431,7 @@ void Spell::EffectKillCreditPersonal(SpellEffIndex effIndex)
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
- unitTarget->ToPlayer()->KilledMonsterCredit(m_spellInfo->Effects[effIndex].MiscValue, 0);
+ unitTarget->ToPlayer()->KilledMonsterCredit(m_spellInfo->Effects[effIndex].MiscValue);
}
void Spell::EffectKillCredit(SpellEffIndex effIndex)