Merge remote-tracking branch 'origin/master' into mmaps

This commit is contained in:
Nay committed 2012-12-23 16:02:26 +00:00
commit 79b1895223
25 files changed
+618 -131

No files matched your search

+35 -25
View File
@@ -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