Skip to content

Commit

Permalink
Fixed merge errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian committed Aug 14, 2016
1 parent b978174 commit e7b730b
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 39 deletions.
2 changes: 1 addition & 1 deletion src/game/Guild.h
Expand Up @@ -19,7 +19,7 @@
#ifndef MANGOSSERVER_GUILD_H
#define MANGOSSERVER_GUILD_H

#define WITHDRAW_MONEY_UNLIMITED UI64LIT(0xFFFFFFFFFFFFFFFF)
#define WITHDRAW_MONEY_UNLIMITED uint64(0xFFFFFFFFFFFFFFFF)
#define WITHDRAW_SLOT_UNLIMITED 0xFFFFFFFF

#include "Common.h"
Expand Down
1 change: 0 additions & 1 deletion src/game/LootMgr.cpp
Expand Up @@ -375,7 +375,6 @@ LootItem::LootItem(LootStoreItem const& li, uint32 _lootSlot, uint32 threshold)
currentLooterPass = false;
isNotVisibleForML = false;
checkRollNeed = false;
}

if (lootItemType == LOOTITEM_TYPE_CURRENCY)
{
Expand Down
1 change: 1 addition & 0 deletions src/game/MovementHandler.cpp
Expand Up @@ -22,6 +22,7 @@
#include "Opcodes.h"
#include "Log.h"
#include "Player.h"
#include "SpellAuras.h"
#include "MapManager.h"
#include "Transports.h"
#include "BattleGround/BattleGround.h"
Expand Down
5 changes: 4 additions & 1 deletion src/game/Player.cpp
Expand Up @@ -6393,7 +6393,10 @@ void Player::CheckAreaExploreAndOutdoor()
SpellEntry const* spellInfo = sSpellStore.LookupEntry(itr->first);
if (!spellInfo || !IsNeedCastSpellAtOutdoor(spellInfo) || HasAura(itr->first))
continue;
if ((spellInfo->Stances || spellInfo->StancesNot) && !IsNeedCastSpellAtFormApply(spellInfo, GetShapeshiftForm()))

SpellShapeshiftEntry const* shapeShift = spellInfo->GetSpellShapeshift();

if (!shapeShift || (shapeShift->Stances || shapeShift->StancesNot) && !IsNeedCastSpellAtFormApply(spellInfo, GetShapeshiftForm()))
continue;
CastSpell(this, itr->first, true, nullptr);
}
Expand Down
14 changes: 8 additions & 6 deletions src/game/Spell.cpp
Expand Up @@ -1930,7 +1930,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
}

if (!prev->IsWithinLOSInMap(*next)
|| ((m_spellInfo->HasAttribute(SPELL_ATTR_EX6_IGNORE_CC_TARGETS) && !(*next)->CanFreeMove()))
|| (m_spellInfo->HasAttribute(SPELL_ATTR_EX6_IGNORE_CC_TARGETS) && !(*next)->CanFreeMove()))
{
++next;
continue;
Expand All @@ -1945,7 +1945,6 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
}
}
break;
}
case TARGET_ALL_ENEMY_IN_AREA:
FillAreaTargets(targetUnitMap, radius, PUSH_DEST_CENTER, SPELL_TARGETS_AOE_DAMAGE);

Expand Down Expand Up @@ -2998,7 +2997,9 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
// remove caster from the list if required by attribute
if (m_spellInfo->HasAttribute(SPELL_ATTR_EX_CANT_TARGET_SELF))
{
if (targetMode != TARGET_SELF && targetMode != TARGET_SELF2 && m_spellInfo->Effect[effIndex] != SPELL_EFFECT_SUMMON)
const SpellEffectEntry* spellEffect = m_spellInfo->GetSpellEffect(effIndex);

if (targetMode != TARGET_SELF && targetMode != TARGET_SELF2 && (spellEffect && spellEffect->Effect != SPELL_EFFECT_SUMMON))
targetUnitMap.remove(m_caster);
}

Expand Down Expand Up @@ -3076,6 +3077,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
AddGOTarget(*iter, effIndex);
}
}
}

SpellCastResult Spell::PreCastCheck(Aura* triggeredByAura /*= nullptr*/)
{
Expand Down Expand Up @@ -3676,9 +3678,9 @@ void Spell::_handle_immediate_phase()
if(!spellEffect)
continue;
// persistent area auras target only the ground
if (m_spellInfo->Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA ||
if (spellEffect->Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA ||
//summon a gameobject at the spell's destination xyz
(m_spellInfo->Effect == SPELL_EFFECT_TRANS_DOOR && m_spellInfo->EffectImplicitTargetA == TARGET_AREAEFFECT_GO_AROUND_DEST))
(spellEffect->Effect == SPELL_EFFECT_TRANS_DOOR && spellEffect->EffectImplicitTargetA == TARGET_AREAEFFECT_GO_AROUND_DEST))
HandleEffects(nullptr, nullptr, nullptr, SpellEffectIndex(j));
}
}
Expand Down Expand Up @@ -6520,7 +6522,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
break;
}
else if (m_spellInfo->EffectImplicitTargetA[i] == TARGET_SCRIPT_COORDINATES)
else if (spellEffect->EffectImplicitTargetA == TARGET_SCRIPT_COORDINATES)
{
script = true;
continue;
Expand Down
5 changes: 3 additions & 2 deletions src/game/SpellAuras.cpp
Expand Up @@ -1126,7 +1126,8 @@ void Aura::HandleAddModifier(bool apply, bool Real)
else if (opt && spellProto->Id == 37212)
{
// Flametongue Weapon (Passive)
uint64 }
const_cast<SpellClassOptionsEntry*>(opt)->SpellFamilyFlags = ClassFamilyMask(uint64(0x0000000000200000));
}
}

((Player*)GetTarget())->AddSpellMod(this, apply);
Expand Down Expand Up @@ -7598,7 +7599,7 @@ void Aura::PeriodicTick()
// apply damage part to caster if needed (ex. health funnel)
if (target != pCaster && spellProto->SpellVisual[0] == 163)
{
uint32 damage = spellProto->manaPerSecond;
uint32 damage = spellProto->GetManaPerSecond();
uint32 absorb = 0;

pCaster->DealDamageMods(pCaster, damage, &absorb);
Expand Down
18 changes: 9 additions & 9 deletions src/game/SpellEffects.cpp
Expand Up @@ -433,7 +433,7 @@ void Spell::EffectSchoolDMG(SpellEffectEntry const* effect)
case SPELLFAMILY_MAGE:
// remove Arcane Blast buffs at any non-Arcane Blast arcane damage spell.
// NOTE: it removed at hit instead cast because currently spell done-damage calculated at hit instead cast
if ((m_spellInfo->SchoolMask & SPELL_SCHOOL_MASK_ARCANE) && !(classOptions && classOptions->SpellFamilyFlags & UI64LIT(0x20000000)))
if ((m_spellInfo->SchoolMask & SPELL_SCHOOL_MASK_ARCANE) && !(classOptions && classOptions->SpellFamilyFlags & uint64(0x20000000)))
m_caster->RemoveAurasDueToSpell(36032); // Arcane Blast buff
break;
case SPELLFAMILY_WARRIOR:
Expand Down Expand Up @@ -572,7 +572,7 @@ void Spell::EffectSchoolDMG(SpellEffectEntry const* effect)
if (classOptions && classOptions->SpellFamilyFlags & uint64(0x0000000200000000))
m_caster->CastCustomSpell(m_caster, 32409, &damage, nullptr, nullptr, true);
// Improved Mind Blast (Mind Blast in shadow form bonus)
else if (m_caster->GetShapeshiftForm() == FORM_SHADOW && (classOptions && classOptions->SpellFamilyFlags & UI64LIT(0x00002000)))
else if (m_caster->GetShapeshiftForm() == FORM_SHADOW && (classOptions && classOptions->SpellFamilyFlags & uint64(0x00002000)))
{
Unit::AuraList const& ImprMindBlast = m_caster->GetAurasByType(SPELL_AURA_ADD_FLAT_MODIFIER);
for (Unit::AuraList::const_iterator i = ImprMindBlast.begin(); i != ImprMindBlast.end(); ++i)
Expand Down Expand Up @@ -776,10 +776,10 @@ void Spell::EffectSchoolDMG(SpellEffectEntry const* effect)
damage += count * int32(average * IN_MILLISECONDS) / m_caster->GetAttackTime(BASE_ATTACK);
}
// Shield of Righteousness
else if (classOptions && classOptions->SpellFamilyFlags & uint64(0x0010000000000000))
/*else if (classOptions && classOptions->SpellFamilyFlags & uint64(0x0010000000000000))
{
damage += int32(m_caster->GetShieldBlockValue());
}
}*/
// Judgement
else if (m_spellInfo->Id == 54158)
{
Expand Down Expand Up @@ -5452,8 +5452,8 @@ void Spell::EffectSummonType(SpellEffectEntry const* effect)
amount = 1;

// Expected Level (Totem, Pet and Critter may not use this)
uint32 level = responsibleCaster ? std::max(responsibleCaster->getLevel() + m_spellInfo->EffectMultipleValue[eff_idx], 1.0f)
: std::max(m_caster->getLevel() + m_spellInfo->EffectMultipleValue[eff_idx], 1.0f);
uint32 level = responsibleCaster ? std::max(responsibleCaster->getLevel() + effect->EffectMultipleValue, 1.0f)
: std::max(m_caster->getLevel() + effect->EffectMultipleValue, 1.0f);
// level of creature summoned using engineering item based at engineering skill level
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_CastItem)
{
Expand Down Expand Up @@ -5529,7 +5529,7 @@ void Spell::EffectSummonType(SpellEffectEntry const* effect)
if (prop_id == 61)
{
// Totem cases
if (CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(m_spellInfo->EffectMiscValue[eff_idx]))
if (CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(effect->EffectMiscValue))
{
if (cInfo->CreatureType == CREATURE_TYPE_TOTEM)
{
Expand Down Expand Up @@ -5913,7 +5913,7 @@ bool Spell::DoSummonPossessed(CreatureSummonPositions& list, SummonPropertiesEnt

uint32 const& creatureEntry = effect->EffectMiscValue;

Unit* newUnit = m_caster->TakePossessOf(m_spellInfo, prop, effIdx, list[0].x, list[0].y, list[0].z, m_caster->GetOrientation());
Unit* newUnit = m_caster->TakePossessOf(m_spellInfo, prop, effect, list[0].x, list[0].y, list[0].z, m_caster->GetOrientation());
if (!newUnit)
{
sLog.outError("Spell::DoSummonPossessed: creature entry %d for spell %u could not be summoned.", creatureEntry, m_spellInfo->Id);
Expand Down Expand Up @@ -5982,7 +5982,7 @@ bool Spell::DoSummonPet(SpellEffectEntry const* effect)
return false;
}

uint32 level = std::max(m_caster->getLevel() + m_spellInfo->EffectMultipleValue[eff_idx], 1.0f);
uint32 level = std::max(m_caster->getLevel() + effect->EffectMultipleValue, 1.0f);

spawnCreature->SetRespawnCoord(pos);

Expand Down
6 changes: 3 additions & 3 deletions src/game/SpellMgr.cpp
Expand Up @@ -2307,8 +2307,8 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
if (classOptions2 && classOptions2->SpellFamilyName == SPELLFAMILY_MAGE )
{
// Blizzard & Chilled (and some other stacked with blizzard spells
if (classOptions1 && (classOptions1->SpellFamilyFlags & uint64(0x80)) && (classOptions2->SpellFamilyFlags & UI64LIT(0x100000)) ||
(classOptions2->SpellFamilyFlags & uint64(0x80)) && (classOptions1->SpellFamilyFlags & UI64LIT(0x100000)) )
if (classOptions1 && (classOptions1->SpellFamilyFlags & uint64(0x80)) && (classOptions2->SpellFamilyFlags & uint64(0x100000)) ||
(classOptions2->SpellFamilyFlags & uint64(0x80)) && (classOptions1->SpellFamilyFlags & uint64(0x100000)) )
return false;

// Blink & Improved Blink
Expand Down Expand Up @@ -4742,7 +4742,7 @@ int32 GetDiminishingReturnsLimitDuration(DiminishingGroup group, SpellEntry cons
case SPELLFAMILY_HUNTER:
{
// Wyvern Sting
if (classOptions && classOptions->SpellFamilyFlags & Uuint64I64LIT(0x0000100000000000))
if (classOptions && classOptions->SpellFamilyFlags & uint64(0x0000100000000000))
return 6000;
break;
}
Expand Down
1 change: 1 addition & 0 deletions src/game/TradeHandler.cpp
Expand Up @@ -27,6 +27,7 @@
#include "Item.h"
#include "Spell.h"
#include "SocialMgr.h"
#include "Language.h"
#include "DBCStores.h"

void WorldSession::SendTradeStatus(TradeStatus status)
Expand Down
18 changes: 5 additions & 13 deletions src/game/Unit.cpp
Expand Up @@ -1879,11 +1879,6 @@ void Unit::CalculateMeleeDamage(Unit* pVictim, CalcDamageInfo* damageInfo, Weapo

if (mod != 0)
damageInfo->damage = int32((damageInfo->damage) * float((100.0f + mod) / 100.0f));

uint32 crTypeMask = damageInfo->target->GetCreatureTypeMask();

// Increase crit damage from SPELL_AURA_MOD_CRIT_PERCENT_VERSUS
mod += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_CRIT_PERCENT_VERSUS, crTypeMask);

// Resilience - reduce crit damage
uint32 reduction_affected_damage = CalcNotIgnoreDamageReduction(damageInfo->damage, damageInfo->damageSchoolMask);
Expand Down Expand Up @@ -3091,7 +3086,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* pVictim, WeaponAttackT
return MELEE_HIT_CRIT;
}

tmp = (victimDefenseSkill < victimMaxSkillValueForLevel) ? victimDefenseSkill : victimMaxSkillValueForLevel;
//tmp = (victimDefenseSkill < victimMaxSkillValueForLevel) ? victimDefenseSkill : victimMaxSkillValueForLevel;

// mobs can score crushing blows if they're 4 or more levels above victim
// having defense above your maximum (from items, talents etc.) has no effect
Expand Down Expand Up @@ -4605,7 +4600,7 @@ bool Unit::RemoveNoStackAurasDueToAuraHolder(SpellAuraHolder* holder)
if (triggeredBy && sSpellMgr.IsSpellCanAffectSpell(triggeredBy, i_spellProto)) // check if this spell can be triggered by any talent aura
continue;

if (sSpellMgr.IsNoStackSpellDueToSpell(spellProto, i_spellProto))
if (sSpellMgr.IsNoStackSpellDueToSpell(spellProto->Id, i_spellProto->Id))
{
// Its a parent aura (create this aura in ApplyModifier)
if ((*i).second->IsInUse())
Expand Down Expand Up @@ -4957,7 +4952,7 @@ void Unit::RemoveAurasOnCast(SpellEntry const* castedSpellEntry)
SpellEntry const* spellEntry = holder->GetSpellProto();
bool removeThisHolder = false;

if (spellEntry->AuraInterruptFlags & AURA_INTERRUPT_FLAG_UNK2)
if (spellEntry->GetAuraInterruptFlags() & AURA_INTERRUPT_FLAG_UNK2)
{
if (castedSpellEntry->HasAttribute(SPELL_ATTR_EX_NOT_BREAK_STEALTH))
{
Expand Down Expand Up @@ -7444,9 +7439,6 @@ uint32 Unit::SpellCriticalDamageBonus(SpellEntry const* spellProto, uint32 damag
else
critPctDamageMod += pVictim->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_DAMAGE, GetSpellSchoolMask(spellProto));

uint32 creatureTypeMask = pVictim->GetCreatureTypeMask();
critPctDamageMod += GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CRIT_PERCENT_VERSUS, creatureTypeMask);

if (critPctDamageMod != 0)
crit_bonus = int32(crit_bonus * float((100.0f + critPctDamageMod) / 100.0f));

Expand Down Expand Up @@ -12174,9 +12166,9 @@ void Unit::SendCollisionHeightUpdate(float height)
}

// This will create a new creature and set the current unit as the controller of that new creature
Unit* Unit::TakePossessOf(SpellEntry const* spellEntry, SummonPropertiesEntry const* summonProp, uint32 effIdx, float x, float y, float z, float ang)
Unit* Unit::TakePossessOf(SpellEntry const* spellEntry, SummonPropertiesEntry const* summonProp, SpellEffectEntry const* spellEffect, float x, float y, float z, float ang)
{
int32 const& creatureEntry = spellEntry->EffectMiscValue[effIdx];
int32 const& creatureEntry = spellEffect->EffectMiscValue;
CreatureInfo const* cinfo = ObjectMgr::GetCreatureTemplate(creatureEntry);
if (!cinfo)
{
Expand Down
2 changes: 1 addition & 1 deletion src/game/Unit.h
Expand Up @@ -2169,7 +2169,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
bool TakePossessOf(Unit* possessed);

// Take possession of a new spawned unit
Unit* TakePossessOf(SpellEntry const* spellEntry, SummonPropertiesEntry const* summonProp, uint32 effIdx, float x, float y, float z, float ang);
Unit* TakePossessOf(SpellEntry const* spellEntry, SummonPropertiesEntry const* summonProp, SpellEffectEntry const* spellEffect, float x, float y, float z, float ang);

// Reset control to player
void ResetControlState(bool attackCharmer = true);
Expand Down
3 changes: 1 addition & 2 deletions src/game/WorldSocket.cpp
Expand Up @@ -121,8 +121,7 @@ bool WorldSocket::Open()

data << ServerToClient;

if (SendPacket(data) == -1)
return -1;
SendPacket(data);

// Send startup packet.
WorldPacket packet (SMSG_AUTH_CHALLENGE, 37);
Expand Down

0 comments on commit e7b730b

Please sign in to comment.