aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-06-19 23:20:06 -0300
committerariel- <ariel-@users.noreply.github.com>2017-06-19 23:20:06 -0300
commit85a7d5ce9ac68b30da2277cc91d4b70358f1880d (patch)
treedf3d2084ee2e35008903c03178039b9c986e2d08 /src/server/game/Spells/SpellEffects.cpp
parent052fc24315ace866ea1cf610e85df119b68100c9 (diff)
Core: ported headers cleanup from master branch
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp174
1 files changed, 88 insertions, 86 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 3dee9ae956b..21ed4ceec23 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -16,45 +16,49 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "Spell.h"
+#include "AccountMgr.h"
+#include "Battleground.h"
+#include "CellImpl.h"
#include "Common.h"
+#include "Creature.h"
+#include "CreatureAI.h"
#include "DatabaseEnv.h"
-#include "WorldPacket.h"
-#include "Opcodes.h"
-#include "Log.h"
-#include "UpdateMask.h"
-#include "World.h"
-#include "ObjectMgr.h"
-#include "SpellMgr.h"
-#include "Player.h"
-#include "SkillExtraItems.h"
-#include "Unit.h"
-#include "Spell.h"
#include "DynamicObject.h"
-#include "SpellAuras.h"
-#include "SpellAuraEffects.h"
-#include "SharedDefines.h"
-#include "Pet.h"
+#include "Formulas.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "GossipDef.h"
-#include "Creature.h"
-#include "Totem.h"
-#include "CreatureAI.h"
-#include "Battleground.h"
-#include "OutdoorPvPMgr.h"
-#include "Language.h"
-#include "SocialMgr.h"
-#include "Util.h"
-#include "TemporarySummon.h"
#include "GridNotifiers.h"
-#include "CellImpl.h"
-#include "Formulas.h"
-#include "ScriptMgr.h"
-#include "SpellHistory.h"
-#include "GameObjectAI.h"
-#include "AccountMgr.h"
#include "InstanceScript.h"
+#include "Item.h"
+#include "Language.h"
+#include "Log.h"
+#include "LootMgr.h"
+#include "MotionMaster.h"
+#include "ObjectMgr.h"
+#include "Opcodes.h"
+#include "OutdoorPvPMgr.h"
#include "PathGenerator.h"
+#include "Pet.h"
+#include "Player.h"
#include "ReputationMgr.h"
+#include "ScriptMgr.h"
+#include "SkillExtraItems.h"
+#include "SharedDefines.h"
+#include "SocialMgr.h"
+#include "SpellAuraEffects.h"
+#include "SpellAuras.h"
+#include "SpellHistory.h"
+#include "SpellMgr.h"
+#include "TemporarySummon.h"
+#include "Totem.h"
+#include "UpdateMask.h"
+#include "Unit.h"
+#include "Util.h"
+#include "World.h"
+#include "WorldPacket.h"
+#include "WorldSession.h"
pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
{
@@ -282,7 +286,7 @@ void Spell::EffectInstaKill(SpellEffIndex /*effIndex*/)
data << uint32(m_spellInfo->Id);
m_caster->SendMessageToSet(&data, true);
- m_caster->DealDamage(unitTarget, unitTarget->GetHealth(), NULL, NODAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ m_caster->DealDamage(unitTarget, unitTarget->GetHealth(), nullptr, NODAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
}
void Spell::EffectEnvironmentalDMG(SpellEffIndex /*effIndex*/)
@@ -428,7 +432,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
// Calculate damage of Immolate/Shadowflame tick
int32 pdamage = (aura->GetAmount() + aura->GetBonusAmount()) * aura->GetDonePct();
if (Player* modOwner = m_caster->GetSpellModOwner())
- modOwner->ApplySpellMod<SPELLMOD_DOT>(GetSpellInfo()->Id, pdamage);
+ modOwner->ApplySpellMod(GetSpellInfo()->Id, SPELLMOD_DOT, pdamage);
pdamage = unitTarget->SpellDamageBonusTaken(m_caster, aura->GetSpellInfo(), pdamage, DOT);
@@ -460,7 +464,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
if (AuraEffect* aurEff = owner->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, 214, 0))
{
int32 bp0 = aurEff->GetId() == 54037 ? 4 : 8;
- m_caster->CastCustomSpell(m_caster, 54425, &bp0, NULL, NULL, true);
+ m_caster->CastCustomSpell(m_caster, 54425, &bp0, nullptr, nullptr, true);
}
}
}
@@ -880,7 +884,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex)
}
// original caster guid only for GO cast
- m_caster->CastSpell(targets, spellInfo, &values, TRIGGERED_FULL_MASK, NULL, NULL, m_originalCasterGUID);
+ m_caster->CastSpell(targets, spellInfo, &values, TRIGGERED_FULL_MASK, nullptr, nullptr, m_originalCasterGUID);
}
void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex)
@@ -928,7 +932,7 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex)
}
// original caster guid only for GO cast
- m_caster->CastSpell(targets, spellInfo, &values, TRIGGERED_FULL_MASK, NULL, NULL, m_originalCasterGUID);
+ m_caster->CastSpell(targets, spellInfo, &values, TRIGGERED_FULL_MASK, nullptr, nullptr, m_originalCasterGUID);
}
void Spell::EffectForceCast(SpellEffIndex effIndex)
@@ -960,7 +964,7 @@ void Spell::EffectForceCast(SpellEffIndex effIndex)
break;
case 52463: // Hide In Mine Car
case 52349: // Overtake
- unitTarget->CastCustomSpell(unitTarget, spellInfo->Id, &damage, NULL, NULL, true, NULL, NULL, m_originalCasterGUID);
+ unitTarget->CastCustomSpell(unitTarget, spellInfo->Id, &damage, nullptr, nullptr, true, nullptr, nullptr, m_originalCasterGUID);
return;
}
}
@@ -968,7 +972,7 @@ void Spell::EffectForceCast(SpellEffIndex effIndex)
switch (spellInfo->Id)
{
case 72298: // Malleable Goo Summon
- unitTarget->CastSpell(unitTarget, spellInfo->Id, true, NULL, NULL, m_originalCasterGUID);
+ unitTarget->CastSpell(unitTarget, spellInfo->Id, true, nullptr, nullptr, m_originalCasterGUID);
return;
}
@@ -1004,7 +1008,7 @@ void Spell::EffectTriggerRitualOfSummoning(SpellEffIndex effIndex)
finish();
- m_caster->CastSpell((Unit*)NULL, spellInfo, false);
+ m_caster->CastSpell((Unit*)nullptr, spellInfo, false);
}
void Spell::EffectJump(SpellEffIndex effIndex)
@@ -1265,7 +1269,7 @@ void Spell::EffectSendEvent(SpellEffIndex effIndex)
&& effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
return;
- WorldObject* target = NULL;
+ WorldObject* target = nullptr;
// call events for object target if present
if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT_TARGET)
@@ -1379,7 +1383,7 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/)
{
Unit::AuraEffectList const& RejorRegr = unitTarget->GetAuraEffectsByType(SPELL_AURA_PERIODIC_HEAL);
// find most short by duration
- AuraEffect* targetAura = NULL;
+ AuraEffect* targetAura = nullptr;
for (Unit::AuraEffectList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
{
if ((*i)->GetSpellInfo()->SpellFamilyName == SPELLFAMILY_DRUID
@@ -1398,7 +1402,7 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/)
int32 tickheal = (targetAura->GetAmount() + targetAura->GetBonusAmount()) * targetAura->GetDonePct();
if (Player* modOwner = m_caster->GetSpellModOwner())
- modOwner->ApplySpellMod<SPELLMOD_DOT>(targetAura->GetId(), tickheal);
+ modOwner->ApplySpellMod(targetAura->GetId(), SPELLMOD_DOT, tickheal);
unitTarget->SpellHealingBonusTaken(m_caster, targetAura->GetSpellInfo(), tickheal, DOT);
@@ -1529,7 +1533,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype)
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(newitemid);
if (!pProto)
{
- player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
+ player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
return;
}
@@ -1606,7 +1610,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype)
else
{
// if not created by another reason from full inventory or unique items amount limitation
- player->SendEquipError(msg, NULL, NULL, newitemid);
+ player->SendEquipError(msg, nullptr, nullptr, newitemid);
return;
}
}
@@ -1614,12 +1618,12 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype)
if (num_to_add)
{
// create the new item and store it
- Item* pItem = player->StoreNewItem(dest, newitemid, true, Item::GenerateItemRandomPropertyId(newitemid));
+ Item* pItem = player->StoreNewItem(dest, newitemid, true, GenerateItemRandomPropertyId(newitemid));
// was it successful? return error if not
if (!pItem)
{
- player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
+ player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
return;
}
@@ -2054,9 +2058,9 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
// prevent crash at access and unexpected charges counting with item update queue corrupt
if (m_CastItem == m_targets.GetItemTarget())
- m_targets.SetItemTarget(NULL);
+ m_targets.SetItemTarget(nullptr);
- m_CastItem = NULL;
+ m_CastItem = nullptr;
m_castItemGUID.Clear();
m_castItemEntry = 0;
@@ -2075,9 +2079,9 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
// prevent crash at access and unexpected charges counting with item update queue corrupt
if (m_CastItem == m_targets.GetItemTarget())
- m_targets.SetItemTarget(NULL);
+ m_targets.SetItemTarget(nullptr);
- m_CastItem = NULL;
+ m_CastItem = nullptr;
m_castItemGUID.Clear();
m_castItemEntry = 0;
@@ -2099,9 +2103,9 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
// prevent crash at access and unexpected charges counting with item update queue corrupt
if (m_CastItem == m_targets.GetItemTarget())
- m_targets.SetItemTarget(NULL);
+ m_targets.SetItemTarget(nullptr);
- m_CastItem = NULL;
+ m_CastItem = nullptr;
m_castItemGUID.Clear();
m_castItemEntry = 0;
@@ -2160,9 +2164,9 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
int32 duration = m_spellInfo->GetDuration();
if (Player* modOwner = m_originalCaster->GetSpellModOwner())
- modOwner->ApplySpellMod<SPELLMOD_DURATION>(m_spellInfo->Id, duration);
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
- TempSummon* summon = NULL;
+ TempSummon* summon = nullptr;
// determine how many units should be summoned
uint32 numSummons;
@@ -2444,11 +2448,11 @@ void Spell::EffectDispel(SpellEffIndex effIndex)
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->GetCategory() == SPELLCATEGORY_DEVOUR_MAGIC)
{
int32 heal_amount = m_spellInfo->Effects[EFFECT_1].CalcValue();
- m_caster->CastCustomSpell(m_caster, 19658, &heal_amount, NULL, NULL, true);
+ m_caster->CastCustomSpell(m_caster, 19658, &heal_amount, nullptr, nullptr, true);
// Glyph of Felhunter
if (Unit* owner = m_caster->GetOwner())
if (owner->GetAura(56249))
- owner->CastCustomSpell(owner, 19658, &heal_amount, NULL, NULL, true);
+ owner->CastCustomSpell(owner, 19658, &heal_amount, nullptr, nullptr, true);
}
}
@@ -2594,7 +2598,7 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/)
// not scale value for item based reward (/10 value expected)
if (m_CastItem)
{
- unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage/10);
+ unitTarget->ToPlayer()->RewardHonor(nullptr, 1, damage/10);
TC_LOG_DEBUG("spells", "SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %u", m_spellInfo->Id, damage/10, m_CastItem->GetEntry(), unitTarget->ToPlayer()->GetGUID().GetCounter());
return;
}
@@ -2603,13 +2607,13 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/)
if (damage <= 50)
{
uint32 honor_reward = Trinity::Honor::hk_honor_at_level(unitTarget->getLevel(), float(damage));
- unitTarget->ToPlayer()->RewardHonor(NULL, 1, honor_reward);
+ unitTarget->ToPlayer()->RewardHonor(nullptr, 1, honor_reward);
TC_LOG_DEBUG("spells", "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (scale) to player: %u", m_spellInfo->Id, honor_reward, unitTarget->ToPlayer()->GetGUID().GetCounter());
}
else
{
//maybe we have correct honor_gain in damage already
- unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage);
+ unitTarget->ToPlayer()->RewardHonor(nullptr, 1, damage);
TC_LOG_DEBUG("spells", "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (non scale) for player: %u", m_spellInfo->Id, damage, unitTarget->ToPlayer()->GetGUID().GetCounter());
}
}
@@ -2647,8 +2651,8 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex)
unitTarget = player;
// and add a scroll
DoCreateItem(effIndex, m_spellInfo->Effects[effIndex].ItemType);
- itemTarget = NULL;
- m_targets.SetItemTarget(NULL);
+ itemTarget = nullptr;
+ m_targets.SetItemTarget(nullptr);
}
else
{
@@ -2945,7 +2949,7 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex)
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
return;
- Player* owner = NULL;
+ Player* owner = nullptr;
if (m_originalCaster)
{
owner = m_originalCaster->ToPlayer();
@@ -3021,7 +3025,7 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex)
pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
// generate new name for summon pet
- std::string new_name=sObjectMgr->GeneratePetName(petentry);
+ std::string new_name = sObjectMgr->GeneratePetName(petentry);
if (!new_name.empty())
pet->SetName(new_name);
@@ -3200,7 +3204,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
// Skyshatter Harness item set bonus
// Stormstrike
if (AuraEffect* aurEff = m_caster->IsScriptOverriden(m_spellInfo, 5634))
- m_caster->CastSpell(m_caster, 38430, true, NULL, aurEff);
+ m_caster->CastSpell(m_caster, 38430, true, nullptr, aurEff);
break;
}
case SPELLFAMILY_DRUID:
@@ -3463,7 +3467,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
Map* map = target->GetMap();
- G3D::Quat rot = G3D::Matrix3::fromEulerAnglesZYX(target->GetOrientation(), 0.f, 0.f);
+ QuaternionData rot = QuaternionData::fromEulerAnglesZYX(target->GetOrientation(), 0.f, 0.f);
if (!pGameObj->Create(map->GenerateLowGuid<HighGuid::GameObject>(), gameobject_id, map, m_caster->GetPhaseMask(), Position(x, y, z, target->GetOrientation()), rot, 255, GO_STATE_READY))
{
delete pGameObj;
@@ -3550,7 +3554,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
uint32 spell_id = roll_chance_i(20) ? 8854 : 8855;
- m_caster->CastSpell(m_caster, spell_id, true, NULL);
+ m_caster->CastSpell(m_caster, spell_id, true, nullptr);
return;
}
// Brittle Armor - need remove one 24575 Brittle Armor aura
@@ -3631,7 +3635,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
uint8 bag = 19;
uint8 slot = 0;
- Item* item = NULL;
+ Item* item = nullptr;
while (bag) // 256 = 0 due to var type
{
@@ -3859,7 +3863,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
// proc a spellcast
if (Aura* chargesAura = m_caster->GetAura(59907))
{
- m_caster->CastSpell(unitTarget, spell_heal, true, NULL, NULL, m_caster->ToTempSummon()->GetSummonerGUID());
+ m_caster->CastSpell(unitTarget, spell_heal, true, nullptr, nullptr, m_caster->ToTempSummon()->GetSummonerGUID());
if (chargesAura->ModCharges(-1))
m_caster->ToTempSummon()->UnSummon();
}
@@ -3888,14 +3892,14 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
Creature* totem = unitTarget->GetMap()->GetCreature(unitTarget->m_SummonSlot[slot]);
if (totem && totem->IsTotem())
{
- m_caster->CastCustomSpell(totem, 55277, &basepoints0, NULL, NULL, true);
+ m_caster->CastCustomSpell(totem, 55277, &basepoints0, nullptr, nullptr, true);
}
}
// Glyph of Stoneclaw Totem
- if (AuraEffect* aur=unitTarget->GetAuraEffect(63298, 0))
+ if (AuraEffect* aur = unitTarget->GetAuraEffect(63298, 0))
{
basepoints0 *= aur->GetAmount();
- m_caster->CastCustomSpell(unitTarget, 55277, &basepoints0, NULL, NULL, true);
+ m_caster->CastCustomSpell(unitTarget, 55277, &basepoints0, nullptr, nullptr, true);
}
break;
}
@@ -4033,7 +4037,7 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
};
Map* map = m_caster->GetMap();
- G3D::Quat rot = G3D::Matrix3::fromEulerAnglesZYX(pos.GetOrientation(), 0.f, 0.f);
+ QuaternionData rot = QuaternionData::fromEulerAnglesZYX(pos.GetOrientation(), 0.f, 0.f);
if (!pGameObj->Create(map->GenerateLowGuid<HighGuid::GameObject>(), gameobject_id, map, m_caster->GetPhaseMask(), pos, rot, 0, GO_STATE_READY))
{
delete pGameObj;
@@ -4056,8 +4060,8 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
WorldPacket data(SMSG_DUEL_REQUESTED, 8 + 8);
data << uint64(pGameObj->GetGUID());
data << uint64(caster->GetGUID());
- caster->GetSession()->SendPacket(&data);
- target->GetSession()->SendPacket(&data);
+ caster->SendDirectMessage(&data);
+ target->SendDirectMessage(&data);
// create duel-info
DuelInfo* duel = new DuelInfo;
@@ -4334,7 +4338,7 @@ void Spell::EffectFeedPet(SpellEffIndex effIndex)
player->DestroyItemCount(foodItem, count, true);
/// @todo fix crash when a spell has two effects, both pointed at the same item target
- m_caster->CastCustomSpell(pet, m_spellInfo->Effects[effIndex].TriggerSpell, &benefit, NULL, NULL, true);
+ m_caster->CastCustomSpell(pet, m_spellInfo->Effects[effIndex].TriggerSpell, &benefit, nullptr, nullptr, true);
}
void Spell::EffectDismissPet(SpellEffIndex effIndex)
@@ -4382,7 +4386,7 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex)
m_caster->GetClosePoint(x, y, z, DEFAULT_PLAYER_BOUNDING_RADIUS);
Map* map = m_caster->GetMap();
- G3D::Quat rot = G3D::Matrix3::fromEulerAnglesZYX(m_caster->GetOrientation(), 0.f, 0.f);
+ QuaternionData rot = QuaternionData::fromEulerAnglesZYX(m_caster->GetOrientation(), 0.f, 0.f);
if (!go->Create(map->GenerateLowGuid<HighGuid::GameObject>(), go_id, map, m_caster->GetPhaseMask(), Position(x, y, z, m_caster->GetOrientation()), rot, 255, GO_STATE_READY))
{
delete go;
@@ -4633,14 +4637,14 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
float speed = G3D::fuzzyGt(m_spellInfo->Speed, 0.0f) ? m_spellInfo->Speed : SPEED_CHARGE;
// Spell is not using explicit target - no generated path
- if (m_preGeneratedPath.GetPathType() == PATHFIND_BLANK)
+ if (m_preGeneratedPath->GetPathType() == PATHFIND_BLANK)
{
//unitTarget->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ);
Position pos = unitTarget->GetFirstCollisionPosition(unitTarget->GetCombatReach(), unitTarget->GetRelativeAngle(m_caster));
m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ, speed);
}
else
- m_caster->GetMotionMaster()->MoveCharge(m_preGeneratedPath, speed);
+ m_caster->GetMotionMaster()->MoveCharge(*m_preGeneratedPath, speed);
}
if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT_TARGET)
@@ -4924,7 +4928,7 @@ void Spell::EffectDestroyAllTotems(SpellEffIndex /*effIndex*/)
}
ApplyPct(mana, damage);
if (mana)
- m_caster->CastCustomSpell(m_caster, 39104, &mana, NULL, NULL, true);
+ m_caster->CastCustomSpell(m_caster, 39104, &mana, nullptr, nullptr, true);
}
void Spell::EffectDurabilityDamage(SpellEffIndex effIndex)
@@ -5039,7 +5043,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
GameObject* pGameObj = new GameObject;
Position pos = { fx, fy, fz, m_caster->GetOrientation() };
- G3D::Quat rot = G3D::Matrix3::fromEulerAnglesZYX(m_caster->GetOrientation(), 0.f, 0.f);
+ QuaternionData rot = QuaternionData::fromEulerAnglesZYX(m_caster->GetOrientation(), 0.f, 0.f);
if (!pGameObj->Create(cMap->GenerateLowGuid<HighGuid::GameObject>(), name_id, cMap, m_caster->GetPhaseMask(), pos, rot, 255, GO_STATE_READY))
{
delete pGameObj;
@@ -5569,7 +5573,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const*
int32 duration = m_spellInfo->GetDuration();
if (Player* modOwner = m_originalCaster->GetSpellModOwner())
- modOwner->ApplySpellMod<SPELLMOD_DURATION>(m_spellInfo->Id, duration);
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
//TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;
Map* map = caster->GetMap();
@@ -5643,7 +5647,7 @@ void Spell::EffectPlayMusic(SpellEffIndex effIndex)
WorldPacket data(SMSG_PLAY_MUSIC, 4);
data << uint32(soundid);
- unitTarget->ToPlayer()->GetSession()->SendPacket(&data);
+ unitTarget->ToPlayer()->SendDirectMessage(&data);
}
void Spell::EffectSpecCount(SpellEffIndex /*effIndex*/)
@@ -5773,7 +5777,7 @@ void Spell::EffectRechargeManaGem(SpellEffIndex /*effIndex*/)
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item_id);
if (!pProto)
{
- player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
+ player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
return;
}
@@ -5809,10 +5813,8 @@ void Spell::EffectBind(SpellEffIndex effIndex)
player->SetHomebind(homeLoc, areaId);
// binding
- WorldPacket data(SMSG_BINDPOINTUPDATE, 4 + 4 + 4 + 4 + 4);
- data << float(homeLoc.GetPositionX());
- data << float(homeLoc.GetPositionY());
- data << float(homeLoc.GetPositionZ());
+ WorldPacket data(SMSG_BINDPOINTUPDATE, 4 * 3 + 4 + 4);
+ data << TaggedPosition<Position::XYZ>(homeLoc);
data << uint32(homeLoc.GetMapId());
data << uint32(areaId);
player->SendDirectMessage(&data);