mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-02 18:43:48 +00:00
Merge branch 'master' of https://github.com/azerothcore/azerothcore-wotlk into dir-restructure
This commit is contained in:
@@ -1711,20 +1711,16 @@ void AuraEffect::HandlePhase(AuraApplication const* aurApp, uint8 mode, bool app
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
// no-phase is also phase state so same code for apply and remove
|
||||
uint32 newPhase = 0;
|
||||
Unit::AuraEffectList const& phases = target->GetAuraEffectsByType(SPELL_AURA_PHASE);
|
||||
if (!phases.empty())
|
||||
for (Unit::AuraEffectList::const_iterator itr = phases.begin(); itr != phases.end(); ++itr)
|
||||
newPhase |= (*itr)->GetMiscValue();
|
||||
uint32 newPhase = target->GetPhaseByAuras();
|
||||
|
||||
if (Player* player = target->ToPlayer())
|
||||
{
|
||||
if (!newPhase)
|
||||
newPhase = PHASEMASK_NORMAL;
|
||||
|
||||
// GM-mode have mask 0xFFFFFFFF
|
||||
// do not change phase to GM with all phases enabled
|
||||
if (player->IsGameMaster())
|
||||
newPhase = 0xFFFFFFFF;
|
||||
newPhase = PHASEMASK_ANYWHERE;
|
||||
|
||||
player->SetPhaseMask(newPhase, false);
|
||||
player->GetSession()->SendSetPhaseShift(newPhase);
|
||||
@@ -1769,7 +1765,7 @@ void AuraEffect::HandlePhase(AuraApplication const* aurApp, uint8 mode, bool app
|
||||
|
||||
void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
{
|
||||
if (!(mode & AURA_EFFECT_HANDLE_REAL))
|
||||
if (!(mode & AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK))
|
||||
return;
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
@@ -3582,6 +3578,9 @@ void AuraEffect::HandleModMechanicImmunity(AuraApplication const* aurApp, uint8
|
||||
|
||||
switch (GetId())
|
||||
{
|
||||
case 46924: // BladeStorm
|
||||
target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply);
|
||||
break;
|
||||
case 34471: // The Beast Within
|
||||
case 19574: // Bestial Wrath
|
||||
mechanic = IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
|
||||
|
||||
@@ -395,7 +395,7 @@ Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owne
|
||||
|
||||
Aura::Aura(SpellInfo const* spellproto, WorldObject* owner, Unit* caster, Item* castItem, uint64 casterGUID) :
|
||||
m_spellInfo(spellproto), m_casterGuid(casterGUID ? casterGUID : caster->GetGUID()),
|
||||
m_castItemGuid(castItem ? castItem->GetGUID() : 0), m_applyTime(time(NULL)),
|
||||
m_castItemGuid(castItem ? castItem->GetGUID() : 0),m_castItemEntry(castItem ? castItem->GetEntry() : 0), m_applyTime(time(NULL)),
|
||||
m_owner(owner), m_timeCla(0), m_updateTargetMapInterval(0),
|
||||
m_casterLevel(caster ? caster->getLevel() : m_spellInfo->SpellLevel), m_procCharges(0), m_stackAmount(1),
|
||||
m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false)
|
||||
|
||||
@@ -96,6 +96,7 @@ class Aura
|
||||
uint32 GetId() const{ return GetSpellInfo()->Id; }
|
||||
|
||||
uint64 GetCastItemGUID() const { return m_castItemGuid; }
|
||||
uint32 GetCastItemEntry() const { return m_castItemEntry; }
|
||||
uint64 GetCasterGUID() const { return m_casterGuid; }
|
||||
Unit* GetCaster() const;
|
||||
WorldObject* GetOwner() const { return m_owner; }
|
||||
@@ -235,6 +236,7 @@ class Aura
|
||||
SpellInfo const* const m_spellInfo;
|
||||
uint64 const m_casterGuid;
|
||||
uint64 const m_castItemGuid; // it is NOT safe to keep a pointer to the item because it may get deleted
|
||||
uint32 const m_castItemEntry; // when deleted, we could retrieve some information from template instead
|
||||
time_t const m_applyTime;
|
||||
WorldObject* const m_owner; //
|
||||
|
||||
|
||||
@@ -287,6 +287,16 @@ Corpse* SpellCastTargets::GetCorpseTarget() const
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void SpellCastTargets::SetCorpseTarget(Corpse* target)
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
m_objectTarget = target;
|
||||
m_objectTargetGUID = target->GetGUID();
|
||||
m_targetMask |= TARGET_FLAG_CORPSE_MASK;
|
||||
}
|
||||
|
||||
WorldObject* SpellCastTargets::GetObjectTarget() const
|
||||
{
|
||||
return m_objectTarget;
|
||||
@@ -1306,7 +1316,8 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
|
||||
float dis = (float)rand_norm() * (max_dis - min_dis) + min_dis;
|
||||
float x, y, z, angle;
|
||||
angle = (float)rand_norm() * static_cast<float>(M_PI * 35.0f / 180.0f) - static_cast<float>(M_PI * 17.5f / 180.0f);
|
||||
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE, dis, angle);
|
||||
//m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE, dis, angle); this contains extra code that breaks fishing
|
||||
m_caster->GetNearPoint(m_caster, x, y, z, DEFAULT_WORLD_OBJECT_SIZE, dis, m_caster->GetOrientation() + angle);
|
||||
|
||||
float ground = m_caster->GetMap()->GetHeight(m_caster->GetPhaseMask(), x, y, z, true, 120.0f);
|
||||
float liquidLevel = VMAP_INVALID_HEIGHT_VALUE;
|
||||
@@ -2395,6 +2406,23 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*=
|
||||
// Increase time interval for reflected spells by 1.5
|
||||
m_caster->m_Events.AddEvent(new ReflectEvent(m_caster->GetGUID(), targetInfo.targetGUID, m_spellInfo), m_caster->m_Events.CalculateTime(targetInfo.timeDelay));
|
||||
targetInfo.timeDelay += targetInfo.timeDelay >> 1;
|
||||
|
||||
// HACK: workaround check for succubus seduction case
|
||||
// TODO: seduction should be casted only on humanoids (not demons)
|
||||
if (m_caster->IsPet())
|
||||
{
|
||||
CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(m_caster->GetEntry());
|
||||
switch (ci->family)
|
||||
{
|
||||
case CREATURE_FAMILY_SUCCUBUS:
|
||||
{
|
||||
if (m_spellInfo->SpellIconID != 694) // Soothing Kiss
|
||||
cancel();
|
||||
}
|
||||
break;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
targetInfo.reflectResult = SPELL_MISS_NONE;
|
||||
@@ -4545,14 +4573,14 @@ void Spell::WriteAmmoToPacket(WorldPacket* data)
|
||||
{
|
||||
if (uint32 item_id = m_caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i))
|
||||
{
|
||||
if (ItemEntry const* itemEntry = sItemStore.LookupEntry(item_id))
|
||||
if (ItemTemplate const* itemEntry = sObjectMgr->GetItemTemplate(item_id))
|
||||
{
|
||||
if (itemEntry->Class == ITEM_CLASS_WEAPON)
|
||||
{
|
||||
switch (itemEntry->SubClass)
|
||||
{
|
||||
case ITEM_SUBCLASS_WEAPON_THROWN:
|
||||
ammoDisplayID = itemEntry->DisplayId;
|
||||
ammoDisplayID = itemEntry->DisplayInfoID;
|
||||
ammoInventoryType = itemEntry->InventoryType;
|
||||
break;
|
||||
case ITEM_SUBCLASS_WEAPON_BOW:
|
||||
@@ -5788,7 +5816,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
m_pathFinder = new PathGenerator(m_caster);
|
||||
m_pathFinder->CalculatePath(pos.m_positionX, pos.m_positionY, pos.m_positionZ+0.15f, false);
|
||||
G3D::Vector3 endPos = m_pathFinder->GetEndPosition(); // also check distance between target and the point calculated by mmaps
|
||||
if (m_pathFinder->GetPathType()&PATHFIND_NOPATH || target->GetExactDistSq(endPos.x, endPos.y, endPos.z) > maxdist*maxdist || m_pathFinder->getPathLength() > (40.0f + (m_caster->HasAura(58097) ? 5.0f : 0.0f)))
|
||||
if (m_pathFinder->GetPathType() & (PATHFIND_NOPATH | PATHFIND_INCOMPLETE) || target->GetExactDistSq(endPos.x, endPos.y, endPos.z) > maxdist*maxdist || m_pathFinder->getPathLength() > (40.0f + (m_caster->HasAura(58097) ? 5.0f : 0.0f)))
|
||||
return SPELL_FAILED_NOPATH;
|
||||
}
|
||||
break;
|
||||
@@ -6200,7 +6228,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (m_originalCaster && m_originalCaster->GetTypeId() == TYPEID_PLAYER && m_originalCaster->IsAlive())
|
||||
{
|
||||
Battlefield* Bf = sBattlefieldMgr->GetBattlefieldToZoneId(m_originalCaster->GetZoneId());
|
||||
if (AreaTableEntry const* pArea = GetAreaEntryByAreaID(m_originalCaster->GetAreaId()))
|
||||
if (AreaTableEntry const* pArea = sAreaTableStore.LookupEntry(m_originalCaster->GetAreaId()))
|
||||
if ((pArea->flags & AREA_FLAG_NO_FLY_ZONE) || (Bf && !Bf->CanFlyIn()))
|
||||
return SPELL_FAILED_NOT_HERE;
|
||||
}
|
||||
|
||||
@@ -107,6 +107,7 @@ class SpellCastTargets
|
||||
|
||||
uint64 GetCorpseTargetGUID() const;
|
||||
Corpse* GetCorpseTarget() const;
|
||||
void SetCorpseTarget(Corpse* target);
|
||||
|
||||
WorldObject* GetObjectTarget() const;
|
||||
uint64 GetObjectTargetGUID() const;
|
||||
|
||||
@@ -3218,7 +3218,7 @@ void Spell::EffectTaunt(SpellEffIndex /*effIndex*/)
|
||||
return;
|
||||
|
||||
// xinef: Hand of Reckoning, cast before checing canhavethreatlist. fixes damage against pets
|
||||
if (m_spellInfo->Id == 62124 && unitTarget->GetVictim() != m_caster && !unitTarget->IsTotem())
|
||||
if (m_spellInfo->Id == 62124 && unitTarget->GetVictim() != m_caster)
|
||||
m_caster->CastSpell(unitTarget, 67485, true);
|
||||
|
||||
// this effect use before aura Taunt apply for prevent taunt already attacking target
|
||||
@@ -4241,14 +4241,14 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
|
||||
return;
|
||||
|
||||
// Players can only fight a duel in zones with this flag
|
||||
AreaTableEntry const* casterAreaEntry = GetAreaEntryByAreaID(caster->GetAreaId());
|
||||
AreaTableEntry const* casterAreaEntry = sAreaTableStore.LookupEntry(caster->GetAreaId());
|
||||
if (casterAreaEntry && !(casterAreaEntry->flags & AREA_FLAG_ALLOW_DUELS))
|
||||
{
|
||||
SendCastResult(SPELL_FAILED_NO_DUELING); // Dueling isn't allowed here
|
||||
return;
|
||||
}
|
||||
|
||||
AreaTableEntry const* targetAreaEntry = GetAreaEntryByAreaID(target->GetAreaId());
|
||||
AreaTableEntry const* targetAreaEntry = sAreaTableStore.LookupEntry(target->GetAreaId());
|
||||
if (targetAreaEntry && !(targetAreaEntry->flags & AREA_FLAG_ALLOW_DUELS))
|
||||
{
|
||||
SendCastResult(SPELL_FAILED_NO_DUELING); // Dueling isn't allowed here
|
||||
|
||||
@@ -1069,7 +1069,7 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
AreaTableEntry const* pArea = GetAreaEntryByAreaID(player->GetAreaId());
|
||||
AreaTableEntry const* pArea = sAreaTableStore.LookupEntry(player->GetAreaId());
|
||||
if (!(pArea && pArea->flags & AREA_FLAG_NO_FLY_ZONE))
|
||||
return false;
|
||||
if (!player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !player->HasAuraType(SPELL_AURA_FLY))
|
||||
@@ -2513,7 +2513,7 @@ void SpellMgr::LoadSpellAreas()
|
||||
}
|
||||
}
|
||||
|
||||
if (spellArea.areaId && !GetAreaEntryByAreaID(spellArea.areaId))
|
||||
if (spellArea.areaId && !sAreaTableStore.LookupEntry(spellArea.areaId))
|
||||
{
|
||||
sLog->outErrorDb("Spell %u listed in `spell_area` have wrong area (%u) requirement", spell, spellArea.areaId);
|
||||
continue;
|
||||
@@ -6243,8 +6243,8 @@ void SpellMgr::LoadDbcDataCorrections()
|
||||
}
|
||||
|
||||
// Xinef: The Veiled Sea area in outlands (Draenei zone), client blocks casting flying mounts
|
||||
for (uint32 i = 0; i < sAreaStore.GetNumRows(); ++i)
|
||||
if (AreaTableEntry* areaEntry = const_cast<AreaTableEntry*>(sAreaStore.LookupEntry(i)))
|
||||
for (uint32 i = 0; i < sAreaTableStore.GetNumRows(); ++i)
|
||||
if (AreaTableEntry* areaEntry = const_cast<AreaTableEntry*>(sAreaTableStore.LookupEntry(i)))
|
||||
{
|
||||
if (areaEntry->ID == 3479)
|
||||
areaEntry->flags |= AREA_FLAG_NO_FLY_ZONE;
|
||||
|
||||
Reference in New Issue
Block a user