aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.cpp19
-rwxr-xr-xsrc/server/game/Entities/GameObject/GameObject.cpp18
-rwxr-xr-xsrc/server/game/Entities/Object/Object.cpp6
-rwxr-xr-xsrc/server/game/Entities/Pet/Pet.cpp8
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp6
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp22
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp6
7 files changed, 46 insertions, 39 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index 330a38ba5dd..8562c66c29f 100755
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -985,28 +985,19 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
if (!conditions.empty())
break;
- for (int j = 0; j < MAX_SPELL_EFFECTS; ++j)
+ if (pSpellInfo->NeedsExplicitUnitTarget())
{
- if (pSpellInfo->Effects[j].TargetA.GetTarget() == TARGET_UNIT_TARGET_ENEMY ||
- pSpellInfo->Effects[j].TargetB.GetTarget() == TARGET_UNIT_TARGET_ENEMY ||
- pSpellInfo->Effects[j].TargetA.GetTarget() == TARGET_UNIT_TARGET_ANY ||
- pSpellInfo->Effects[j].TargetB.GetTarget() == TARGET_UNIT_TARGET_ANY)
- {
- bIsItemSpellValid = true;
- break;
- }
- }
-
- if (bIsItemSpellValid)
+ bIsItemSpellValid = true;
break;
+ }
}
}
}
if (!bIsItemSpellValid)
{
- sLog->outErrorDb("Conditions: CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET for item %u, which either doesn't have item spelltrigger or its spells don't have implicit target "
- "TARGET_UNIT_TARGET_ENEMY(6), TARGET_UNIT_TARGET_ANY(25), or the spells are already listed in CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET conditions.", cond->mSourceEntry);
+ sLog->outErrorDb("Conditions: CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET for item %u, which either doesn't have item spelltrigger or its spells don't allow caster to select a unit target"
+ ", or the spells are already listed in CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET conditions.", cond->mSourceEntry);
break;
}
break;
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 3548ef3bc63..e26c6710b78 100755
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -228,13 +228,13 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
if (GetGOInfo()->trap.stealthed)
{
m_stealth.AddFlag(STEALTH_TRAP);
- m_stealth.AddValue(STEALTH_TRAP, 300);
+ m_stealth.AddValue(STEALTH_TRAP, 70);
}
if (GetGOInfo()->trap.invisible)
{
m_invisibility.AddFlag(INVISIBILITY_TRAP);
- m_invisibility.AddValue(INVISIBILITY_TRAP, 70);
+ m_invisibility.AddValue(INVISIBILITY_TRAP, 300);
}
break;
@@ -850,6 +850,20 @@ bool GameObject::IsAlwaysVisibleFor(WorldObject const* seer) const
if (IsTransport())
return true;
+ if (!seer)
+ return false;
+
+ // Always seen by owner and friendly units
+ if (uint64 guid = GetOwnerGUID())
+ {
+ if (seer->GetGUID() == guid)
+ return true;
+
+ Unit* owner = GetOwner();
+ if (owner && seer->isType(TYPEMASK_UNIT) && owner->IsFriendlyTo(((Unit*)seer)))
+ return true;
+ }
+
return false;
}
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index 1a8eb8f82e2..c9b25b66cdc 100755
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -1807,11 +1807,15 @@ bool WorldObject::CanDetectStealthOf(WorldObject const* obj) const
// Level difference: 5 point / level, starting from level 1.
// There may be spells for this and the starting points too, but
- // not in the DBCs of the client.
+ // not in the DBCs of the client.
detectionValue += int32(getLevelForTarget(obj) - 1) * 5;
// Apply modifiers
detectionValue += m_stealthDetect.GetValue(StealthType(i));
+ if (obj->isType(TYPEMASK_GAMEOBJECT))
+ if (Unit* owner = ((GameObject*)obj)->GetOwner())
+ detectionValue -= int32(owner->getLevelForTarget(this) - 1) * 5;
+
detectionValue -= obj->m_stealth.GetValue(StealthType(i));
// Calculate max distance
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp
index 607508593f6..bf6dc3b67d9 100755
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -1151,6 +1151,9 @@ void Pet::_LoadAuras(uint32 timediff)
int32 baseDamage[3];
Field* fields = result->Fetch();
uint64 caster_guid = fields[0].GetUInt64();
+ // NULL guid stored - pet is the caster of the spell - see Pet::_SaveAuras
+ if (!caster_guid)
+ caster_guid = GetGUID();
uint32 spellid = fields[1].GetUInt32();
uint8 effmask = fields[2].GetUInt8();
uint8 recalculatemask = fields[3].GetUInt8();
@@ -1239,9 +1242,12 @@ void Pet::_SaveAuras(SQLTransaction& trans)
}
}
+ // don't save guid of caster in case we are caster of the spell - guid for pet is generated every pet load, so it won't match saved guid anyways
+ uint64 casterGUID = (itr->second->GetCasterGUID() == GetGUID()) ? NULL : itr->second->GetCasterGUID();
+
trans->PAppend("INSERT INTO pet_aura (guid, caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) "
"VALUES ('%u', '" UI64FMTD "', '%u', '%u', '%u', '%u', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%u')",
- m_charmInfo->GetPetNumber(), itr->second->GetCasterGUID(), itr->second->GetId(), effMask, recalculateMask,
+ m_charmInfo->GetPetNumber(), casterGUID, itr->second->GetId(), effMask, recalculateMask,
itr->second->GetStackAmount(), damage[0], damage[1], damage[2], baseDamage[0], baseDamage[1], baseDamage[2],
itr->second->GetMaxDuration(), itr->second->GetDuration(), itr->second->GetCharges());
}
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 63b1729766b..5b18713740f 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -14643,7 +14643,7 @@ void Unit::SendMovementFlagUpdate()
{
WorldPacket data;
BuildHeartBeatMsg(&data);
- SendMessageToSet(&data, true);
+ SendMessageToSet(&data, false);
}
bool Unit::IsSitState() const
@@ -17050,9 +17050,7 @@ void Unit::_ExitVehicle(Position const* exitPosition)
if (Player* player = ToPlayer())
player->ResummonPetTemporaryUnSummonedIfAny();
- WorldPacket data2;
- BuildHeartBeatMsg(&data2);
- SendMessageToSet(&data2, true);
+ SendMovementFlagUpdate();
if (vehicle->GetBase()->HasUnitTypeMask(UNIT_MASK_MINION))
if (((Minion*)vehicle->GetBase())->GetOwner() == this)
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index dc804d72103..b1aeb41a126 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2859,20 +2859,6 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
InitExplicitTargets(*targets);
- if (Player* plrCaster = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself())
- {
- //check for special spell conditions
- ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL, m_spellInfo->Id);
- if (!conditions.empty())
- if (!sConditionMgr->IsPlayerMeetToConditions(plrCaster, conditions))
- {
- //SendCastResult(SPELL_FAILED_DONT_REPORT);
- SendCastResult(plrCaster, m_spellInfo, m_cast_count, SPELL_FAILED_DONT_REPORT);
- finish(false);
- return;
- }
- }
-
// Fill aura scaling information
if (m_caster->IsControlledByPlayer() && !m_spellInfo->IsPassive() && m_spellInfo->SpellLevel && !m_spellInfo->IsChanneled() && !(_triggeredCastFlags & TRIGGERED_IGNORE_AURA_SCALING))
{
@@ -4730,6 +4716,14 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_DONT_REPORT;
}
+ // check spell caster's conditions from database
+ if (Player* plrCaster = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself())
+ {
+ ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL, m_spellInfo->Id);
+ if (!conditions.empty() && !sConditionMgr->IsPlayerMeetToConditions(plrCaster, conditions))
+ return SPELL_FAILED_DONT_REPORT;
+ }
+
// Don't check explicit target for passive spells (workaround) (check should be skipped only for learn case)
// those spells may have incorrect target entries or not filled at all (for example 15332)
// such spells when learned are not targeting anyone using targeting system, they should apply directly to caster instead
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
index d01e2663b12..3e9d8144c19 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
@@ -427,6 +427,7 @@ public:
bCanUseWill = true;
if (!pFetchTene->isInCombat())
{
+ DoCast(me, SPELL_POWER_OF_TENEBRON);
AddDrakeLootMode();
++drakeCount;
}
@@ -441,6 +442,7 @@ public:
bCanUseWill = true;
if (!pFetchShad->isInCombat())
{
+ DoCast(me, SPELL_POWER_OF_SHADRON);
AddDrakeLootMode();
++drakeCount;
}
@@ -455,6 +457,7 @@ public:
bCanUseWill = true;
if (!pFetchVesp->isInCombat())
{
+ DoCast(me, SPELL_POWER_OF_VESPERON);
AddDrakeLootMode();
++drakeCount;
}
@@ -1017,7 +1020,6 @@ public:
{
DoScriptText(SAY_TENEBRON_AGGRO, me);
DoZoneInCombat();
- DoCast(me, SPELL_POWER_OF_TENEBRON);
}
void KilledUnit(Unit* /*victim*/)
@@ -1113,7 +1115,6 @@ public:
{
DoScriptText(SAY_SHADRON_AGGRO, me);
DoZoneInCombat();
- DoCast(me, SPELL_POWER_OF_SHADRON);
}
void KilledUnit(Unit* /*victim*/)
@@ -1212,7 +1213,6 @@ public:
{
DoScriptText(SAY_VESPERON_AGGRO, me);
DoZoneInCombat();
- DoCast(me, SPELL_POWER_OF_VESPERON);
}
void KilledUnit(Unit* /*victim*/)