aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Unit
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Entities/Unit')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp60
-rw-r--r--src/server/game/Entities/Unit/Unit.h1
2 files changed, 36 insertions, 25 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 02a0ec7d5b9..dee977de054 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -5572,28 +5572,14 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
// Shadow's Fate (Shadowmourne questline)
case 71169:
{
- uint32 spellId = 0;
-
- switch (GetEntry())
+ Unit* caster = triggeredByAura->GetCaster();
+ if (caster && caster->GetTypeId() == TYPEID_PLAYER && caster->ToPlayer()->GetQuestStatus(24547) == QUEST_STATUS_INCOMPLETE)
{
- case 36678: // NPC: Professor Putricide
- spellId = 71518; // Spell: Unholy Infusion Credit
- break;
- case 37955: // NPC: Blood-Queen Lana'thel
- spellId = 72934; // Spell: Quest Credit
- break;
- case 36853: // NPC: Sindragosa <Queen of the Frostbrood>
- spellId = 72289; // Spell: Frost Infusion Quest Credit
- break;
- default:
- break;
+ CastSpell(caster, 71203, true);
+ return true;
}
- if (spellId)
- CastSpell((Unit*)NULL, spellId, true);
-
- CastSpell((Unit*)NULL, 71203, true);
-
- return true;
+ else
+ return false;
}
// Essence of the Blood Queen
case 70871:
@@ -9039,11 +9025,15 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
case 71169:
{
// Victim needs more checks so bugs, rats or summons can not be affected by the proc.
- if (GetTypeId() != TYPEID_PLAYER || victim->GetTypeId() != TYPEID_UNIT || victim->GetCreatureType() == CREATURE_TYPE_CRITTER)
+ if (GetTypeId() != TYPEID_PLAYER || !victim || victim->GetTypeId() != TYPEID_UNIT || victim->GetCreatureType() == CREATURE_TYPE_CRITTER)
return false;
Player* player = ToPlayer();
- if (player->GetQuestStatus(24547) != QUEST_STATUS_INCOMPLETE)
+ if (player->GetQuestStatus(24547) == QUEST_STATUS_INCOMPLETE)
+ {
+ break;
+ }
+ else if (player->GetDifficulty(true) == RAID_DIFFICULTY_25MAN_NORMAL || player->GetDifficulty(true) == RAID_DIFFICULTY_25MAN_HEROIC)
{
uint32 spellId = 0;
uint32 questId = 0;
@@ -9067,8 +9057,11 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
if (player->GetQuestStatus(questId) != QUEST_STATUS_INCOMPLETE || !player->HasAura(spellId))
return false;
+
+ break;
}
- break;
+ else
+ return false;
}
}
@@ -12113,7 +12106,10 @@ void Unit::CombatStart(Unit* target, bool initialAggro)
if (!target->isInCombat() && target->GetTypeId() != TYPEID_PLAYER
&& !target->ToCreature()->HasReactState(REACT_PASSIVE) && target->ToCreature()->IsAIEnabled)
{
- target->ToCreature()->AI()->AttackStart(this);
+ if (target->isPet())
+ target->ToCreature()->AI()->AttackedBy(this); // PetAI has special handler before AttackStart()
+ else
+ target->ToCreature()->AI()->AttackStart(this);
}
SetInCombatWith(target);
@@ -17329,10 +17325,24 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool cas
else
{
UpdatePosition(x, y, z, orientation, true);
- SendMovementFlagUpdate();
+ Position pos; // dummy, not used for creatures.
+ SendTeleportPacket(pos);
+ UpdateObjectVisibility();
}
}
+void Unit::SendTeleportPacket(Position& oldPos)
+{
+ WorldPacket data2(MSG_MOVE_TELEPORT, 38);
+ data2.append(GetPackGUID());
+ BuildMovementPacket(&data2);
+
+ if (GetTypeId() == TYPEID_PLAYER)
+ Relocate(&oldPos);
+
+ SendMessageToSet(&data2, false);
+}
+
bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool teleport)
{
// prevent crash when a bad coord is sent by the client
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index bba58a2f5e9..5dbf800dc31 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1593,6 +1593,7 @@ class Unit : public WorldObject
void SendSpellDamageImmune(Unit* target, uint32 spellId);
void NearTeleportTo(float x, float y, float z, float orientation, bool casting = false);
+ void SendTeleportPacket(Position& oldPos);
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport = false);
// returns true if unit's position really changed
bool UpdatePosition(const Position &pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); }