diff options
-rw-r--r-- | sql/updates/1018_wrold.sql | 6 | ||||
-rw-r--r-- | sql/world_spell_full.sql | 6 | ||||
-rw-r--r-- | src/bindings/scripts/ScriptMgr.cpp | 7 | ||||
-rw-r--r-- | src/bindings/scripts/include/sc_creature.cpp | 21 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp | 4 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp | 1 | ||||
-rw-r--r-- | src/game/ObjectMgr.cpp | 10 | ||||
-rw-r--r-- | src/game/ObjectMgr.h | 2 | ||||
-rw-r--r-- | src/game/Player.cpp | 10 | ||||
-rw-r--r-- | src/game/Spell.cpp | 30 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 17 | ||||
-rw-r--r-- | src/game/SpellAuras.h | 1 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 21 | ||||
-rw-r--r-- | src/game/SpellMgr.h | 15 | ||||
-rw-r--r-- | src/game/Unit.cpp | 41 | ||||
-rw-r--r-- | src/trinitycore/trinitycore.conf.dist | 2 |
16 files changed, 139 insertions, 55 deletions
diff --git a/sql/updates/1018_wrold.sql b/sql/updates/1018_wrold.sql new file mode 100644 index 00000000000..ca298faa8f3 --- /dev/null +++ b/sql/updates/1018_wrold.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (31224,41292,44007,44867); +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES +(31224, -1543, 2, 'Cloak of Shadows - Flare'), +(41292, 42017, 2, 'Aura of Suffering'), +(44007, -43657, 2, 'Storm Eye Safe Zone Immune'), +(44867, -46019, 2, 'Spectral Exhaustion - Teleport: Spectral Realm');
\ No newline at end of file diff --git a/sql/world_spell_full.sql b/sql/world_spell_full.sql index 9e18dd4d194..1c71285a593 100644 --- a/sql/world_spell_full.sql +++ b/sql/world_spell_full.sql @@ -15,6 +15,7 @@ CREATE TABLE `spell_linked_spell` ( INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES -- class +(31224, -1543, 2, 'Cloak of Shadows - Flare'), (15237, 23455, 0, 'Holy Nova (rank1)'), (15430, 23458, 0, 'Holy Nova (rank2)'), (15431, 23459, 0, 'Holy Nova (rank3)'), @@ -37,6 +38,7 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comm -- Zul'aman (44008, 45265, 1, 'Static Disruption Visual'), (43648, 44007, 1, 'Storm Eye Safe Zone'), +(44007, -43657, 2, 'Storm Eye Safe Zone Immune'), (43658, 43653, 0, 'Electrical Arc Visual'), (43658, 43654, 0, 'Electrical Arc Visual'), (43658, 43655, 0, 'Electrical Arc Visual'), @@ -52,8 +54,7 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comm (39908, 40017, 1, 'Eye Blast'), (40604, 40616, 1, 'Fel Rage Aura'), (40616, 41625, 1, 'Fel Rage Aura'), -(41292, 42017, 1, 'Aura of Suffering'), -(-41292, -42017, 0, 'Aura of Suffering'), +(41292, 42017, 2, 'Aura of Suffering'), -- sunwell (44869, 44866, 1, 'Spectral Blast Portal'), # (44869, 46648, 1, 'Spectral Blast Visual'), cause severe lag seems should be casted by go @@ -62,6 +63,7 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comm # (46021, 44852, 1, 'Spectral Realm Aura'), 44852 makes boss friendly to you (-46021, 46020, 0, 'Teleport: Normal Realm'), (46020, 44867, 1, 'Spectral Exhaustion'), +(44867, -46019, 2, 'Spectral Exhaustion - Teleport: Spectral Realm'), (45661, 45665, 1, 'Encapsulate'), (45347, -45348, 1, 'Remove Flame Touched'), (45348, -45347, 1, 'Remove Dark Touched'), diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index 2819405f733..a5ac7075e31 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -64,6 +64,8 @@ uint32 EAI_ErrorLevel; //*** End EventAI data *** void FillSpellSummary(); +void LoadOverridenSQLData(); +void LoadOverridenDBCData(); // -- Scripts to be added -- @@ -1822,6 +1824,11 @@ void ScriptsInit() // ------------------- outstring_log(">> Loaded %i C++ Scripts.", num_sc_scripts); + + outstring_log(">> Load Overriden SQL Data."); + LoadOverridenSQLData(); + outstring_log(">> Load Overriden DBC Data."); + LoadOverridenDBCData(); } //********************************* diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index 346e381e4d7..48a3a1abbc7 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -8,6 +8,7 @@ #include "precompiled.h" #include "Item.h" #include "Spell.h" +#include "ObjectMgr.h" // Spell summary for ScriptedAI::SelectSpell struct TSpellSummary { @@ -828,3 +829,23 @@ void Scripted_NoMovementAI::AttackStart(Unit* who) DoStartNoMovement(who); } } + +void LoadOverridenSQLData() +{ + GameObjectInfo *goInfo; + + // Sunwell Plateau : Kalecgos : Spectral Rift + goInfo = const_cast<GameObjectInfo*>(GetGameObjectInfo(187055)); + if(goInfo && goInfo->type == GAMEOBJECT_TYPE_GOOBER) + goInfo->goober.lockId = 1714; // need LOCKTYPE_QUICK_OPEN +} + +void LoadOverridenDBCData() +{ + SpellEntry *spellInfo; + + // Black Temple : Illidan : Parasitic Shadowfiend Passive + spellInfo = const_cast<SpellEntry*>(GetSpellStore()->LookupEntry(41913)); + if(spellInfo) + spellInfo->EffectApplyAuraName[0] = 4; // proc debuff, and summon infinite fiends +} diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp index bb7c59e2d0e..5b764367d06 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp @@ -368,10 +368,6 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI pInstance = ((ScriptedInstance*)c->GetInstanceData()); m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); Reset(); - - SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SHADOWFIEND_PASSIVE); - if(TempSpell) - TempSpell->EffectApplyAuraName[0] = 4; // proc debuff, and summon infinite fiends } ScriptedInstance* pInstance; diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp index 2141d8dcb2e..edcf0c09c13 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp @@ -24,7 +24,6 @@ EndScriptData */ #include "precompiled.h" #include "def_magisters_terrace.h" #include "WorldPacket.h" -#include "ObjectMgr.h" #define SAY_AGGRO -1585023 //This yell should be done when the room is cleared. For now, set it as aggro yell. #define SAY_PHOENIX -1585024 diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 2ae6efc5320..0c9ebcd19b8 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -7919,6 +7919,16 @@ ObjectMgr::ScriptNameMap & GetScriptNames() return objmgr.GetScriptNames(); } +GameObjectInfo const *GetGameObjectInfo(uint32 id) +{ + return objmgr.GetGameObjectInfo(id); +} + +CreatureInfo const *GetCreatureInfo(uint32 id) +{ + return objmgr.GetCreatureTemplate(id); +} + void ObjectMgr::LoadTransportEvents() { diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index 4c6a37794f6..249a0394668 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -948,5 +948,7 @@ TRINITY_DLL_SPEC bool LoadTrinityStrings(DatabaseType& db, char const* table,int TRINITY_DLL_SPEC uint32 GetAreaTriggerScriptId(uint32 trigger_id); TRINITY_DLL_SPEC uint32 GetScriptId(const char *name); TRINITY_DLL_SPEC ObjectMgr::ScriptNameMap& GetScriptNames(); +TRINITY_DLL_SPEC GameObjectInfo const *GetGameObjectInfo(uint32 id); +TRINITY_DLL_SPEC CreatureInfo const *GetCreatureInfo(uint32 id); #endif diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 8a2a9982d4e..5f94f3f246a 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -19612,11 +19612,13 @@ void Player::UpdateAreaDependentAuras( uint32 newArea ) uint32 Player::GetCorpseReclaimDelay(bool pvp) const { - if( pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP) || - !pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) ) + if(pvp) { - return copseReclaimDelay[0]; + if(!sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) + return copseReclaimDelay[0]; } + else if(!sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) ) + return 0; time_t now = time(NULL); // 0..2 full period @@ -19687,6 +19689,8 @@ void Player::SendCorpseReclaimDelay(bool load) else delay = GetCorpseReclaimDelay(pvp); + if(!delay) return; + //! corpse reclaim delay 30 * 1000ms or longer at often deaths WorldPacket data(SMSG_CORPSE_RECLAIM_DELAY, 4); data << uint32(delay*1000); diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 376f53f7dfd..428aca13f8c 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1154,15 +1154,14 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) if(m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->AI()) ((Creature*)m_caster)->AI()->SpellHitTarget(unit, m_spellInfo); - if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id + 1000000)) + if(m_customAttr & SPELL_ATTR_CU_LINK_HIT) { - for(std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i) - { - if(spell_triggered < 0) - unit->RemoveAurasDueToSpell(-(*i)); - else - unit->CastSpell(unit, *i, true, 0, 0, m_caster->GetGUID()); - } + if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id + SPELL_LINK_HIT)) + for(std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i) + if(*i < 0) + unit->RemoveAurasDueToSpell(-(*i)); + else + unit->CastSpell(unit, *i, true, 0, 0, m_caster->GetGUID()); } //This is not needed with procflag patch @@ -2272,15 +2271,14 @@ void Spell::cast(bool skipCheck) TakePower(); } - if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id)) + if(m_customAttr & SPELL_ATTR_CU_LINK_CAST) { - for(std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i) - { - if(spell_triggered < 0) - m_caster->RemoveAurasDueToSpell(-(*i)); - else - m_caster->CastSpell(m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster, *i, true); - } + if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id)) + for(std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i) + if(*i < 0) + m_caster->RemoveAurasDueToSpell(-(*i)); + else + m_caster->CastSpell(m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster, *i, true); } SetExecutedCurrently(false); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 41a1e9f5cfb..8eeaf564145 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -240,7 +240,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleNULL, //183 SPELL_AURA_MOD_CRITICAL_THREAT &Aura::HandleNoImmediateEffect, //184 SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst &Aura::HandleNoImmediateEffect, //185 SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst - &Aura::HandleModAttackerSpellHitChance, //186 SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE implemented in Unit::MagicSpellHitResult + &Aura::HandleNoImmediateEffect, //186 SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE implemented in Unit::MagicSpellHitResult &Aura::HandleNoImmediateEffect, //187 SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE implemented in Unit::GetUnitCriticalChance &Aura::HandleNoImmediateEffect, //188 SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_CHANCE implemented in Unit::GetUnitCriticalChance &Aura::HandleModRating, //189 SPELL_AURA_MOD_RATING @@ -2094,12 +2094,6 @@ void Aura::HandleAuraDummy(bool apply, bool Real) return; } - // electrical storm safe zone - if (GetId() == 44007) - { - m_target->ApplySpellImmune(44007, IMMUNITY_ID, 43657, apply); - return; - } break; } case SPELLFAMILY_MAGE: @@ -6430,15 +6424,6 @@ void Aura::HandleAuraConvertRune(bool apply, bool Real) } } -void Aura::HandleModAttackerSpellHitChance(bool apply, bool Real) -{ - if(GetId() != 31224) - return; - - //cloak of shadows : flare - m_target->ApplySpellImmune(31224, IMMUNITY_ID, 1543, apply); -} - void Aura::HandleModPossess(bool apply, bool Real) { if(!Real) diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 06bbc22af12..c09feca92b9 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -210,7 +210,6 @@ class TRINITY_DLL_SPEC Aura void HandleAuraConvertRune(bool apply, bool Real); void HandleAuraIncreaseBaseHealthPercent(bool Apply, bool Real); void HandleNoReagentUseAura(bool Apply, bool Real); - void HandleModAttackerSpellHitChance(bool apply, bool Real); void HandlePhase(bool Apply, bool Real); virtual ~Aura(); diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 6cef85b7fc5..eaa63ef417f 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -2347,8 +2347,27 @@ void SpellMgr::LoadSpellLinked() continue; } + if(trigger > 0) + { + switch(type) + { + case 0: mSpellCustomAttr[trigger] |= SPELL_ATTR_CU_LINK_CAST; break; + case 1: mSpellCustomAttr[trigger] |= SPELL_ATTR_CU_LINK_HIT; break; + case 2: mSpellCustomAttr[trigger] |= SPELL_ATTR_CU_LINK_AURA; break; + } + } + else + { + mSpellCustomAttr[-trigger] |= SPELL_ATTR_CU_LINK_REMOVE; + } + if(type) //we will find a better way when more types are needed - trigger += 1000000; + { + if(trigger > 0) + trigger += SPELL_LINKED_MAX_SPELLS * type; + else + trigger -= SPELL_LINKED_MAX_SPELLS * type; + } mSpellLinkedMap[trigger].push_back(effect); ++count; diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 8d9f7e54972..149250b5e72 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -312,6 +312,16 @@ enum SpellSpecific SPELL_PRESENCE = 21, }; +#define SPELL_LINKED_MAX_SPELLS 200000 + +enum SpellLinkedType +{ + SPELL_LINK_CAST = 0, // +: cast; -: remove + SPELL_LINK_HIT = 1 * 200000, + SPELL_LINK_AURA = 2 * 200000, // +: aura; -: immune + SPELL_LINK_REMOVE = 0, +}; + SpellSpecific GetSpellSpecific(uint32 spellId); // Different spell properties @@ -778,6 +788,11 @@ inline bool IsProfessionSkill(uint32 skill) #define SPELL_ATTR_CU_AURA_SPELL 0x00000080 #define SPELL_ATTR_CU_DIRECT_DAMAGE 0x00000100 #define SPELL_ATTR_CU_CHARGE 0x00000200 +#define SPELL_ATTR_CU_LINK_CAST 0x00000400 +#define SPELL_ATTR_CU_LINK_HIT 0x00000800 +#define SPELL_ATTR_CU_LINK_AURA 0x00001000 +#define SPELL_ATTR_CU_LINK_REMOVE 0x00002000 + typedef std::vector<uint32> SpellCustomAttribute; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index dad619bab86..9d50436d6be 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3713,6 +3713,18 @@ bool Unit::AddAura(Aura *Aur) } Aur->ApplyModifier(true,true); + + uint32 id = Aur->GetId(); + if(spellmgr.GetSpellCustomAttr(id) & SPELL_ATTR_CU_LINK_AURA) + { + if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(id + SPELL_LINK_AURA)) + for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr) + if(*itr < 0) + ApplySpellImmune(id, IMMUNITY_ID, *itr, true); + else if(Unit* caster = Aur->GetCaster()) + caster->AddAura(*itr, this); + } + sLog.outDebug("Aura %u now is in use", Aur->GetModifier()->m_auraname); return true; } @@ -4107,15 +4119,24 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode) if(mode != AURA_REMOVE_BY_STACK) { - if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(-(int32)Aur->GetSpellProto()->Id)) + uint32 id = Aur->GetId(); + if(spellmgr.GetSpellCustomAttr(id) & SPELL_ATTR_CU_LINK_REMOVE) { - for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr) - { - if(spell_triggered < 0) - RemoveAurasDueToSpell(-(*itr)); - else if(Unit* caster = Aur->GetCaster()) - CastSpell(this, *itr, true, 0, 0, caster->GetGUID()); - } + if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(-(int32)id)) + for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr) + if(*itr < 0) + RemoveAurasDueToSpell(-(*itr)); + else if(Unit* caster = Aur->GetCaster()) + CastSpell(this, *itr, true, 0, 0, caster->GetGUID()); + } + if(spellmgr.GetSpellCustomAttr(id) & SPELL_ATTR_CU_LINK_AURA) + { + if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(id + SPELL_LINK_AURA)) + for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr) + if(*itr < 0) + ApplySpellImmune(id, IMMUNITY_ID, *itr, false); + else + RemoveAurasDueToSpell(*itr); } } @@ -12572,12 +12593,12 @@ void Unit::AddAura(uint32 spellId, Unit* target) if(target->IsImmunedToSpellEffect(spellInfo, i)) continue; - if(spellInfo->EffectImplicitTargetA[i] == TARGET_UNIT_CASTER) + /*if(spellInfo->EffectImplicitTargetA[i] == TARGET_UNIT_CASTER) { Aura *Aur = CreateAura(spellInfo, i, NULL, this, this); AddAura(Aur); } - else + else*/ { Aura *Aur = CreateAura(spellInfo, i, NULL, target, this); target->AddAura(Aur); diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist index 827d5c238e7..1ceb1ec37df 100644 --- a/src/trinitycore/trinitycore.conf.dist +++ b/src/trinitycore/trinitycore.conf.dist @@ -1098,7 +1098,7 @@ DurabilityLossChance.Parry = 0.05 DurabilityLossChance.Block = 0.05 Death.SicknessLevel = 11 Death.CorpseReclaimDelay.PvP = 1 -Death.CorpseReclaimDelay.PvE = 1 +Death.CorpseReclaimDelay.PvE = 0 ################################################################################################################### # |