aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/GameObject/GameObject.cpp5
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp12
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp24
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp16
-rw-r--r--src/server/scripts/Northrend/Ulduar/ulduar/boss_hodir.cpp39
5 files changed, 49 insertions, 47 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 5d4eeb48111..b325a7fb407 100755
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -1575,8 +1575,9 @@ void GameObject::Use(Unit* user)
return;
}
default:
- sLog->outError("GameObject::Use(): unit (type: %u, guid: %u, name: %s) tries to use object (guid: %u, entry: %u, name: %s) of unknown type (%u)",
- user->GetTypeId(), user->GetGUIDLow(), user->GetName(), GetGUIDLow(), GetEntry(), GetGOInfo()->name.c_str(), GetGoType());
+ if (GetGoType() >= MAX_GAMEOBJECT_TYPE)
+ sLog->outError("GameObject::Use(): unit (type: %u, guid: %u, name: %s) tries to use object (guid: %u, entry: %u, name: %s) of unknown type (%u)",
+ user->GetTypeId(), user->GetGUIDLow(), user->GetName(), GetGUIDLow(), GetEntry(), GetGOInfo()->name.c_str(), GetGoType());
break;
}
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index cff76936aa8..c200eddb257 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -8033,13 +8033,9 @@ void Player::_ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackTy
for (AuraEffectList::const_iterator itr = auraDamageFlatList.begin(); itr != auraDamageFlatList.end(); ++itr)
_ApplyWeaponDependentAuraDamageMod(item, attackType, *itr, apply);
- float mod = 100.0f;
AuraEffectList const& auraDamagePctList = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
for (AuraEffectList::const_iterator itr = auraDamagePctList.begin(); itr != auraDamagePctList.end(); ++itr)
- if ((apply && item->IsFitToSpellRequirements((*itr)->GetSpellInfo())) || HasItemFitToSpellRequirements((*itr)->GetSpellInfo(), item))
- mod += (*itr)->GetAmount();
-
- SetFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT, mod/100.0f);
+ _ApplyWeaponDependentAuraDamageMod(item, attackType, *itr, apply);
}
void Player::_ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, AuraEffect const* aura, bool apply)
@@ -8088,13 +8084,17 @@ void Player::_ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType att
switch (aura->GetAuraType())
{
case SPELL_AURA_MOD_DAMAGE_DONE: unitModType = TOTAL_VALUE; break;
+ case SPELL_AURA_MOD_DAMAGE_PERCENT_DONE: unitModType = TOTAL_PCT; break;
default: return;
}
if (item->IsFitToSpellRequirements(aura->GetSpellInfo()))
{
HandleStatModifier(unitMod, unitModType, float(aura->GetAmount()), apply);
- ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS, aura->GetAmount(), apply);
+ if (unitModType == TOTAL_VALUE)
+ ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS, aura->GetAmount(), apply);
+ else
+ ApplyModSignedFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT, aura->GetAmount() / 100.0f, apply);
}
}
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 8745acce08d..379af2e508a 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -11761,6 +11761,7 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT
// ..done
AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
+ {
if (spellProto)
{
if ((*i)->GetMiscValue() & spellProto->GetSchoolMask())
@@ -11778,28 +11779,15 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT
AddPctN(DoneTotalMod, (*i)->GetAmount());
}
}
- else if (player)
+ else
{
- if (!((*i)->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK))
+ if ((*i)->GetMiscValue() & GetMeleeDamageSchoolMask() &&
+ (*i)->GetSpellInfo()->EquippedItemClass == -1)
{
- EquipmentSlots slot;
-
- switch (attType)
- {
- case BASE_ATTACK: slot = EQUIPMENT_SLOT_MAINHAND; break;
- case OFF_ATTACK: slot = EQUIPMENT_SLOT_OFFHAND; break;
- case RANGED_ATTACK: slot = EQUIPMENT_SLOT_RANGED; break;
- default: return;
- }
-
- Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot);
-
- if (item && !item->IsBroken() && item->IsFitToSpellRequirements((*i)->GetSpellInfo()))
- AddPctN(DoneTotalMod, (*i)->GetAmount());
- }
- else if (player->HasItemFitToSpellRequirements((*i)->GetSpellInfo()))
AddPctN(DoneTotalMod, (*i)->GetAmount());
+ }
}
+ }
AuraEffectList const& mDamageDoneVersus = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS);
for (AuraEffectList::const_iterator i = mDamageDoneVersus.begin(); i != mDamageDoneVersus.end(); ++i)
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index b3e955de11f..899034db369 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -2553,12 +2553,10 @@ void AuraEffect::HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode,
return;
}
+ // if disarm aura is to be removed, remove the flag first to reapply damage/aura mods
if (!apply)
target->RemoveFlag(field, flag);
- if (apply)
- target->SetFlag(field, flag);
-
// Handle damage modification, shapeshifted druids are not affected
if (target->GetTypeId() == TYPEID_PLAYER && !target->IsInFeralForm())
{
@@ -2567,10 +2565,17 @@ void AuraEffect::HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode,
uint8 attacktype = Player::GetAttackBySlot(slot);
if (attacktype < MAX_ATTACK)
+ {
target->ToPlayer()->_ApplyWeaponDamage(slot, pItem->GetTemplate(), NULL, !apply);
+ target->ToPlayer()->_ApplyWeaponDependentAuraMods(pItem, WeaponAttackType(attacktype), !apply);
+ }
}
}
+ // if disarm effects should be applied, wait to set flag until damage mods are unapplied
+ if (apply)
+ target->SetFlag(field, flag);
+
if (target->GetTypeId() == TYPEID_UNIT && target->ToCreature()->GetCurrentEquipmentId())
target->UpdateDamagePhysical(attType);
}
@@ -4499,8 +4504,9 @@ void AuraEffect::HandleModDamagePercentDone(AuraApplication const* aurApp, uint8
if (!target)
return;
- if (target->HasItemFitToSpellRequirements(GetSpellInfo()))
- target->ApplyModSignedFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT, GetAmount() / 100.0f, apply);
+ for(int i = 0; i < MAX_ATTACK; ++i)
+ if(Item* item = target->GetWeaponForAttack(WeaponAttackType(i),false))
+ target->_ApplyWeaponDependentAuraDamageMod(item, WeaponAttackType(i), this, apply);
}
void AuraEffect::HandleModOffhandDamagePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const
diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_hodir.cpp
index 3b86968c2d2..bb21da94bc5 100644
--- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_hodir.cpp
+++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_hodir.cpp
@@ -138,14 +138,14 @@ enum HodirActions
ACTION_CHEESE_THE_FREEZE = 2,
};
-#define ACHIEVEMENT_CHEESE_THE_FREEZE RAID_MODE(2961, 2962)
-#define ACHIEVEMENT_GETTING_COLD_IN_HERE RAID_MODE(2967, 2968)
-#define ACHIEVEMENT_THIS_CACHE_WAS_RARE RAID_MODE(3182, 3184)
-#define ACHIEVEMENT_COOLEST_FRIENDS RAID_MODE(2963, 2965)
-#define FRIENDS_COUNT RAID_MODE(4, 8)
+#define ACHIEVEMENT_CHEESE_THE_FREEZE RAID_MODE<uint8>(2961, 2962)
+#define ACHIEVEMENT_GETTING_COLD_IN_HERE RAID_MODE<uint8>(2967, 2968)
+#define ACHIEVEMENT_THIS_CACHE_WAS_RARE RAID_MODE<uint8>(3182, 3184)
+#define ACHIEVEMENT_COOLEST_FRIENDS RAID_MODE<uint8>(2963, 2965)
+#define FRIENDS_COUNT RAID_MODE<uint8>(4, 8)
#define DATA_GETTING_COLD_IN_HERE 29672968 // 2967, 2968 are achievement IDs
-const Position SummonPositions[8] =
+Position const SummonPositions[8] =
{
{ 1983.75f, -243.36f, 432.767f, 1.57f }, // Field Medic Penny && Battle-Priest Eliza
{ 1999.90f, -230.49f, 432.767f, 1.57f }, // Eivi Nightfeather && Tor Greycloud
@@ -157,9 +157,16 @@ const Position SummonPositions[8] =
{ 1976.60f, -233.53f, 432.767f, 1.57f }, // Sissy Flamecuffs && Veesha Blazeweaver
};
-uint32 Entry[8] =
+uint32 const Entry[8] =
{
- 32897, 33325, 33328, 32893, 33326, 32901, 32900, 33327,
+ NPC_FIELD_MEDIC_PENNY,
+ NPC_EIVI_NIGHTFEATHER,
+ NPC_ELEMENTALIST_MAHFUUN,
+ NPC_MISSY_FLAMECUFFS,
+ NPC_FIELD_MEDIC_JESSI,
+ NPC_ELLIE_NIGHTFEATHER,
+ NPC_ELEMENTALIST_AVUUN,
+ NPC_SISSY_FLAMECUFFS,
};
class npc_flash_freeze : public CreatureScript
@@ -452,7 +459,7 @@ class boss_hodir : public CreatureScript
DoMeleeAttackIfReady();
}
- void DoAction(const int32 action)
+ void DoAction(int32 const action)
{
switch (action)
{
@@ -540,7 +547,7 @@ class npc_icicle : public CreatureScript
CreatureAI* GetAI(Creature* creature) const
{
- return new npc_icicleAI(creature);
+ return GetUlduarAI<npc_icicleAI>(creature);
};
};
@@ -580,7 +587,7 @@ class npc_snowpacked_icicle : public CreatureScript
CreatureAI* GetAI(Creature* creature) const
{
- return new npc_snowpacked_icicleAI(creature);
+ return GetUlduarAI<npc_snowpacked_icicleAI>(creature);
};
};
@@ -657,7 +664,7 @@ class npc_hodir_priest : public CreatureScript
CreatureAI* GetAI(Creature* creature) const
{
- return new npc_hodir_priestAI(creature);
+ return GetUlduarAI<npc_hodir_priestAI>(creature);
};
};
@@ -719,7 +726,7 @@ class npc_hodir_shaman : public CreatureScript
CreatureAI* GetAI(Creature* creature) const
{
- return new npc_hodir_shamanAI(creature);
+ return GetUlduarAI<npc_hodir_shamanAI>(creature);
};
};
@@ -780,7 +787,7 @@ class npc_hodir_druid : public CreatureScript
CreatureAI* GetAI(Creature* creature) const
{
- return new npc_hodir_druidAI(creature);
+ return GetUlduarAI<npc_hodir_druidAI>(creature);
};
};
@@ -861,7 +868,7 @@ class npc_hodir_mage : public CreatureScript
CreatureAI* GetAI(Creature* creature) const
{
- return new npc_hodir_mageAI(creature);
+ return GetUlduarAI<npc_hodir_mageAI>(creature);
};
};
@@ -895,7 +902,7 @@ class npc_toasty_fire : public CreatureScript
CreatureAI* GetAI(Creature* creature) const
{
- return new npc_toasty_fireAI(creature);
+ return GetUlduarAI<npc_toasty_fireAI>(creature);
};
};