From 3703f4891def906b405d37787b7b993e2a652491 Mon Sep 17 00:00:00 2001 From: mknjc Date: Thu, 7 May 2009 18:20:55 +0200 Subject: [PATCH 1/4] Backported TC2 commit 3157 (megamage: *Fix the bug that fishing bobber does not have correct position.) --HG-- branch : trunk --- src/game/Spell.cpp | 14 ++++++++++++-- src/game/SpellMgr.h | 6 ++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 91d6622425e..664e52b26c0 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1593,9 +1593,19 @@ void Spell::SetTargetMap(uint32 i, uint32 cur) switch(cur) { case TARGET_UNIT_CASTER: - case TARGET_UNIT_CASTER_FISHING: AddUnitTarget(m_caster, i); break; + case TARGET_UNIT_CASTER_FISHING: + { + AddUnitTarget(m_caster, i); + float min_dis = GetSpellMinRange(m_spellInfo, true); + float max_dis = GetSpellMaxRange(m_spellInfo, true); + float dis = rand_norm() * (max_dis - min_dis) + min_dis; + float x, y, z; + m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE, dis); + m_targets.setDestination(x, y, z); + break; + } case TARGET_UNIT_MASTER: if(Unit* owner = m_caster->GetCharmerOrOwner()) AddUnitTarget(owner, i); @@ -2471,7 +2481,7 @@ void Spell::_handle_immediate_phase() { if(spellmgr.EffectTargetType[m_spellInfo->Effect[j]] == SPELL_REQUIRE_DEST) { - if(!m_targets.HasDst()) + if(!m_targets.HasDst()) // FIXME: this will ignore dest set in effect m_targets.setDestination(m_caster); HandleEffects(m_originalCaster, NULL, NULL, j); } diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 70b81403a52..7c5a0874e41 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -326,6 +326,12 @@ inline bool IsSpellHaveEffect(SpellEntry const *spellInfo, SpellEffects effect) return true; return false; } +inline float GetSpellMinRange(SpellEntry const *spellInfo, bool positive) +{ + return positive + ? GetSpellMinRangeForFriend(sSpellRangeStore.LookupEntry(spellInfo->rangeIndex)) + : GetSpellMinRangeForHostile(sSpellRangeStore.LookupEntry(spellInfo->rangeIndex)); +} //bool IsNoStackAuraDueToAura(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2); From 4b7d260a61922f0f592a428334b483f24bf5f77d Mon Sep 17 00:00:00 2001 From: Anubisss Date: Thu, 7 May 2009 20:19:14 +0200 Subject: [PATCH 2/4] *Fix Merciless Totem of the Third Wind's proc. Proc for Lesser Healing Wave instead of Healing Wave. --HG-- branch : trunk --- sql/updates/TC1_1477_world_spell.sql | 3 +++ sql/world_spell_full.sql | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 sql/updates/TC1_1477_world_spell.sql diff --git a/sql/updates/TC1_1477_world_spell.sql b/sql/updates/TC1_1477_world_spell.sql new file mode 100644 index 00000000000..a7f9bd30b59 --- /dev/null +++ b/sql/updates/TC1_1477_world_spell.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_proc_event` WHERE `entry` = 42370; +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(42370, 0x00, 11, 0x00000080, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); diff --git a/sql/world_spell_full.sql b/sql/world_spell_full.sql index c33b05c168c..9e1c65dd0d2 100644 --- a/sql/world_spell_full.sql +++ b/sql/world_spell_full.sql @@ -378,3 +378,10 @@ DELETE FROM spell_target_position WHERE `id` IN (46019, 46020); INSERT INTO spell_target_position () VALUES (46019, 580, 1704.34, 928.17, -74.558, 0); INSERT INTO spell_target_position () VALUES (46020, 580, 1704.34, 928.17, 53.079, 0); +-- -------- +-- PROC +-- -------- +DELETE FROM `spell_proc_event` WHERE `entry` IN (42370); +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(42370, 0x00, 11, 0x00000080, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); -- Merciless Totem of the Third Wind -- + From 3dc839536ae74e264fbe553ec257a220ff6b0156 Mon Sep 17 00:00:00 2001 From: Anubisss Date: Thu, 7 May 2009 20:48:17 +0200 Subject: [PATCH 3/4] *Fix a typo in Alar's script pointed by jojo. Thank you. --HG-- branch : trunk --- .../scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp index 52c2433ae43..a66d8b7e9e8 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp @@ -410,7 +410,8 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI else { Unit *target = NULL; - if(Phase1 && target && (target = m_creature->SelectNearestTarget(5))) + target = m_creature->SelectNearestTarget(5); + if(Phase1 && target) m_creature->AI()->AttackStart(target); else { From 5b9dae20b11243a19c37570392ab25a4bcdd63cd Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 7 May 2009 18:06:20 -0500 Subject: [PATCH 4/4] *Fix build. By Kudlaty. --HG-- branch : trunk --- src/game/Spell.cpp | 4 ++-- src/game/SpellMgr.h | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 664e52b26c0..2227bc4c92b 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1598,8 +1598,8 @@ void Spell::SetTargetMap(uint32 i, uint32 cur) case TARGET_UNIT_CASTER_FISHING: { AddUnitTarget(m_caster, i); - float min_dis = GetSpellMinRange(m_spellInfo, true); - float max_dis = GetSpellMaxRange(m_spellInfo, true); + float min_dis = GetSpellMinRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex)); + float max_dis = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex)); float dis = rand_norm() * (max_dis - min_dis) + min_dis; float x, y, z; m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE, dis); diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 7c5a0874e41..70b81403a52 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -326,12 +326,6 @@ inline bool IsSpellHaveEffect(SpellEntry const *spellInfo, SpellEffects effect) return true; return false; } -inline float GetSpellMinRange(SpellEntry const *spellInfo, bool positive) -{ - return positive - ? GetSpellMinRangeForFriend(sSpellRangeStore.LookupEntry(spellInfo->rangeIndex)) - : GetSpellMinRangeForHostile(sSpellRangeStore.LookupEntry(spellInfo->rangeIndex)); -} //bool IsNoStackAuraDueToAura(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2);