From e619246d58b4e2a8972164c8e92880efac2cb240 Mon Sep 17 00:00:00 2001 From: Dehravor Date: Sat, 25 Jan 2014 10:55:29 +0100 Subject: [PATCH 01/25] Core/SkillHandler: Check if player is using proper NPC on talent reset --- src/server/game/Handlers/SkillHandler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/game/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp index bbbe1a4987f..fe893314b87 100644 --- a/src/server/game/Handlers/SkillHandler.cpp +++ b/src/server/game/Handlers/SkillHandler.cpp @@ -68,6 +68,9 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket& recvData) return; } + if (!unit->isCanTrainingAndResetTalentsOf(_player)) + return; + // remove fake death if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); From c6650ecc7197aab566b30d74f42aff7e2be52bdd Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Fri, 24 Jan 2014 19:48:15 +0100 Subject: [PATCH 02/25] Core/Spells: Move Pilgrims Bounty BuffFood in AuraScript (mimimi) --- .../2014_01_24_00_world_spell_script_name.sql | 13 ++++ .../game/Spells/Auras/SpellAuraEffects.cpp | 15 ----- src/server/scripts/Spells/spell_holiday.cpp | 61 +++++++++++++++++++ 3 files changed, 74 insertions(+), 15 deletions(-) create mode 100644 sql/updates/world/2014_01_24_00_world_spell_script_name.sql diff --git a/sql/updates/world/2014_01_24_00_world_spell_script_name.sql b/sql/updates/world/2014_01_24_00_world_spell_script_name.sql new file mode 100644 index 00000000000..51030a39a85 --- /dev/null +++ b/sql/updates/world/2014_01_24_00_world_spell_script_name.sql @@ -0,0 +1,13 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ( +'spell_gen_slow_roasted_turkey', +'spell_gen_cranberry_chutney', +'spell_gen_spice_bread_stuffing', +'spell_gen_pumpkin_pie', +'spell_gen_candied_sweet_potato' +); +INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES +(65422, 'spell_gen_slow_roasted_turkey'), -- Slow-Roasted Turkey +(65420, 'spell_gen_cranberry_chutney'), -- Cranberry Chutney +(65419, 'spell_gen_spice_bread_stuffing'), -- Spice Bread Stuffing +(65421, 'spell_gen_pumpkin_pie'), -- Pumpkin Pie +(65418, 'spell_gen_candied_sweet_potato'); -- Candied Sweet Potato diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index e403bf34cc9..c769a0b6aea 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5570,21 +5570,6 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) case 46736: triggerSpellId = 46737; break; - case 65418: //Well Fed - Candied Sweet Potatoes - triggerSpellId = 65410; - break; - case 65419: //Well Fed - Spice Bread Stuffing - triggerSpellId = 65416; - break; - case 65420: //Well Fed - Cranberry Chutney - triggerSpellId = 65412; - break; - case 65421: //Well Fed - Pumpkin Pie - triggerSpellId = 65415; - break; - case 65422: //Well Fed - Slow-Roasted Turkey - triggerSpellId = 65414; - break; } break; } diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index bb84606dece..08aa19a4755 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -277,6 +277,61 @@ class spell_hallow_end_tricky_treat : public SpellScriptLoader } }; +enum PilgrimsBountyBuffFood +{ + // Pilgrims Bounty Buff Food + SPELL_WELL_FED_AP_TRIGGER = 65414, + SPELL_WELL_FED_ZM_TRIGGER = 65412, + SPELL_WELL_FED_HIT_TRIGGER = 65416, + SPELL_WELL_FED_HASTE_TRIGGER = 65410, + SPELL_WELL_FED_SPIRIT_TRIGGER = 65415 +}; + +class spell_pilgrims_bounty_buff_food : public SpellScriptLoader +{ + private: + uint32 _triggeredSpellId; + public: + spell_pilgrims_bounty_buff_food(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { } + + class spell_pilgrims_bounty_buff_food_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pilgrims_bounty_buff_food_AuraScript) + private: + uint32 _triggeredSpellId; + + public: + spell_pilgrims_bounty_buff_food_AuraScript(uint32 triggeredSpellId) : AuraScript(), _triggeredSpellId(triggeredSpellId) { } + + bool Load() + { + _handled = false; + return true; + } + + void HandleTriggerSpell(AuraEffect const* /*aurEff*/) + { + if (_handled) + return; + + _handled = true; + GetTarget()->CastSpell(GetTarget(), _triggeredSpellId, true); + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_pilgrims_bounty_buff_food_AuraScript::HandleTriggerSpell, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } + + bool _handled; + }; + + AuraScript* GetAuraScript() const + { + return new spell_pilgrims_bounty_buff_food_AuraScript(_triggeredSpellId); + } +}; + enum Mistletoe { SPELL_CREATE_MISTLETOE = 26206, @@ -396,6 +451,12 @@ void AddSC_holiday_spell_scripts() new spell_hallow_end_trick(); new spell_hallow_end_trick_or_treat(); new spell_hallow_end_tricky_treat(); + // Pilgrims Bounty + new spell_pilgrims_bounty_buff_food("spell_gen_slow_roasted_turkey", SPELL_WELL_FED_AP_TRIGGER); + new spell_pilgrims_bounty_buff_food("spell_gen_cranberry_chutney", SPELL_WELL_FED_ZM_TRIGGER); + new spell_pilgrims_bounty_buff_food("spell_gen_spice_bread_stuffing", SPELL_WELL_FED_HIT_TRIGGER); + new spell_pilgrims_bounty_buff_food("spell_gen_pumpkin_pie", SPELL_WELL_FED_SPIRIT_TRIGGER); + new spell_pilgrims_bounty_buff_food("spell_gen_candied_sweet_potato", SPELL_WELL_FED_HASTE_TRIGGER); // Winter Veil new spell_winter_veil_mistletoe(); new spell_winter_veil_px_238_winter_wondervolt(); From 6b25c2b4147a237ab07c99dbd3563cedfda2f8fc Mon Sep 17 00:00:00 2001 From: Discover- Date: Sat, 25 Jan 2014 16:59:01 +0100 Subject: [PATCH 03/25] Core/Gameobjects: Fix an exploit where it was possible to use gameobjects from any distance. Fixes for example picking up the WSG flag from any distance using hacking tools. --- .../game/Entities/GameObject/GameObject.cpp | 16 ++++++++++++++ .../game/Entities/GameObject/GameObject.h | 2 ++ src/server/game/Entities/Player/Player.cpp | 22 +++---------------- src/server/game/Handlers/SpellHandler.cpp | 10 +++++---- 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 21d5ba0d21a..578622cbb0b 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -2209,3 +2209,19 @@ void GameObject::GetRespawnPosition(float &x, float &y, float &z, float* ori /* if (ori) *ori = GetOrientation(); } + +float GameObject::GetInteractionDistance() +{ + switch (GetGoType()) + { + /// @todo find out how the client calculates the maximal usage distance to spellless working + // gameobjects like guildbanks and mailboxes - 10.0 is a just an abitrary choosen number + case GAMEOBJECT_TYPE_GUILD_BANK: + case GAMEOBJECT_TYPE_MAILBOX: + return 10.0f; + case GAMEOBJECT_TYPE_FISHINGHOLE: + return 20.0f + CONTACT_DISTANCE; // max spell range + default: + return INTERACTION_DISTANCE; + } +} diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 0ef03723cb4..84abc391bc6 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -830,6 +830,8 @@ class GameObject : public WorldObject, public GridObject, public Map float GetStationaryZ() const { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetPositionZ(); return GetPositionZ(); } float GetStationaryO() const { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetOrientation(); return GetOrientation(); } + float GetInteractionDistance(); + protected: bool AIM_Initialize(); void UpdateModel(); // updates model in case displayId were changed diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index eab8df2cd9c..b324b5281f9 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2765,30 +2765,14 @@ GameObject* Player::GetGameObjectIfCanInteractWith(uint64 guid, GameobjectTypes { if (go->GetGoType() == type) { - float maxdist; - switch (type) - { - /// @todo find out how the client calculates the maximal usage distance to spellless working - // gameobjects like guildbanks and mailboxes - 10.0 is a just an abitrary choosen number - case GAMEOBJECT_TYPE_GUILD_BANK: - case GAMEOBJECT_TYPE_MAILBOX: - maxdist = 10.0f; - break; - case GAMEOBJECT_TYPE_FISHINGHOLE: - maxdist = 20.0f+CONTACT_DISTANCE; // max spell range - break; - default: - maxdist = INTERACTION_DISTANCE; - break; - } - - if (go->IsWithinDistInMap(this, maxdist)) + if (go->IsWithinDistInMap(this, go->GetInteractionDistance())) return go; - TC_LOG_DEBUG("maps", "IsGameObjectOfTypeInRange: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal 10 is allowed)", go->GetGOInfo()->name.c_str(), + TC_LOG_DEBUG("maps", "GetGameObjectIfCanInteractWith: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal 10 is allowed)", go->GetGOInfo()->name.c_str(), go->GetGUIDLow(), GetName().c_str(), GetGUIDLow(), go->GetDistance(this)); } } + return NULL; } diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 75a98247186..ba30803e8c2 100644 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -266,19 +266,21 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) void WorldSession::HandleGameObjectUseOpcode(WorldPacket& recvData) { uint64 guid; - recvData >> guid; TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_GAMEOBJ_USE Message [guid=%u]", GUID_LOPART(guid)); if (GameObject* obj = GetPlayer()->GetMap()->GetGameObject(guid)) { + if (!obj->IsWithinDistInMap(GetPlayer(), obj->GetInteractionDistance())) + return; + // ignore for remote control state - if (_player->m_mover != _player) - if (!(_player->IsOnVehicle(_player->m_mover) || _player->IsMounted()) && !obj->GetGOInfo()->IsUsableMounted()) + if (GetPlayer()->m_mover != GetPlayer()) + if (!(GetPlayer()->IsOnVehicle(GetPlayer()->m_mover) || GetPlayer()->IsMounted()) && !obj->GetGOInfo()->IsUsableMounted()) return; - obj->Use(_player); + obj->Use(GetPlayer()); } } From 725d5dc4a62c3d1c8fd3de4d4340cfaf73513e57 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sat, 25 Jan 2014 19:51:21 +0100 Subject: [PATCH 04/25] DB/SAI: Fix Scalewing Serpent By burned, closes #6285 --- sql/updates/world/2014_01_24_01_world_sai.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sql/updates/world/2014_01_24_01_world_sai.sql diff --git a/sql/updates/world/2014_01_24_01_world_sai.sql b/sql/updates/world/2014_01_24_01_world_sai.sql new file mode 100644 index 00000000000..56ecec3bafc --- /dev/null +++ b/sql/updates/world/2014_01_24_01_world_sai.sql @@ -0,0 +1,11 @@ +-- Scalewing Serpent SAI +SET @ENTRY := 20749; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,0,2000,6000,12000,13000,11,37841,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Scalewing Serpent - Combat - Casts Lightning Strike'), +(@ENTRY,0,1,0,31,0,100,0,37841,0,0,0,33,21910,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Scalewing Serpent - On Spellhit - Killcredit'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=20749; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(22,2,20749,0,0,1,0,37830,0,0,0,0,0, '', 'SAI - Scalewing Serpent gives kill credit if quest item aura is applied'); From edc292bb32818701b0937d2183135d30d2e525f5 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sat, 25 Jan 2014 20:27:01 +0100 Subject: [PATCH 05/25] DB/Creature: Rhapsody Shindigger By MitchesD closes #11191 --- sql/updates/world/2014_01_24_02_world_creature_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2014_01_24_02_world_creature_template.sql diff --git a/sql/updates/world/2014_01_24_02_world_creature_template.sql b/sql/updates/world/2014_01_24_02_world_creature_template.sql new file mode 100644 index 00000000000..be8bb9d6f07 --- /dev/null +++ b/sql/updates/world/2014_01_24_02_world_creature_template.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_template` SET `gossip_menu_id` = 0 WHERE `entry` = 5634; From a9ac43ea49b1e2ae83c789ec50424533b93a019b Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sat, 25 Jan 2014 20:32:17 +0100 Subject: [PATCH 06/25] DB/SAI: Fix Administering the Salve By dr-j closes #11375 --- .../world/ \t2014_01_24_03_world_sai.sql" | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 "sql/updates/world/ \t2014_01_24_03_world_sai.sql" diff --git "a/sql/updates/world/ \t2014_01_24_03_world_sai.sql" "b/sql/updates/world/ \t2014_01_24_03_world_sai.sql" new file mode 100644 index 00000000000..06fe58f137a --- /dev/null +++ "b/sql/updates/world/ \t2014_01_24_03_world_sai.sql" @@ -0,0 +1,16 @@ +-- +UPDATE `creature_template` SET `ainame`='SmartAI' WHERE `entry`=16847; +DELETE FROM `smart_scripts` WHERE `entryorguid`=16847 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(16847,0,0,1,8,0,100,0,29314,0,60000,60000,33,16847,0,0,0,0,0,7,0,0,0,0,0,0,0,'Debilitated Maghar Grunt - On Spellhit (Quest - Healing Salve) - Give Kill Credit'), +(16847,0,1,2,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Debilitated Maghar Grunt - Linked with Previous Event - Say'), +(16847,0,2,3,61,0,100,0,0,0,0,0,3,16846,0,0,0,0,0,1,0,0,0,0,0,0,0,'Debilitated Maghar Grunt - Linked with Previous Event - Change Entry'), +(16847,0,3,0,61,0,100,0,0,0,0,0,41,15000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Debilitated Maghar Grunt - Linked with Previous Event - Despawn'), +(16847,0,4,0,25,0,100,0,0,0,0,0,3,16847,0,0,0,0,0,1,0,0,0,0,0,0,0,'Debilitated Maghar Grunt - On Spawn - Change Entry'); + + +DELETE FROM `creature_text` WHERE `entry` =16847; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(16847,0,0,'My strength.... is... returning!',12,0,100,0,0,0,'Debilitated Maghar Grunt'), +(16847,0,1,'You''ve found a cure! We will crush our enemies!',12,0,100,0,0,0,'Debilitated Maghar Grunt'), +(16847,0,2,'You''ve restored my health! I''m in your debt, $N.',12,0,100,0,0,0,'Debilitated Maghar Grunt'); From dbd7cd309bd982f812e08d25b75fa34f5e081ad2 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sat, 25 Jan 2014 21:23:34 +0100 Subject: [PATCH 07/25] Rename 2014_01_24_03_world_sai.sql to 2014_01_24_03_world_sai.sql --- .../updates/world/2014_01_24_03_world_sai.sql | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "sql/updates/world/ \t2014_01_24_03_world_sai.sql" => sql/updates/world/2014_01_24_03_world_sai.sql (100%) diff --git "a/sql/updates/world/ \t2014_01_24_03_world_sai.sql" b/sql/updates/world/2014_01_24_03_world_sai.sql similarity index 100% rename from "sql/updates/world/ \t2014_01_24_03_world_sai.sql" rename to sql/updates/world/2014_01_24_03_world_sai.sql From 88a5d010164c5299ebca5b8b124f03c386c77fed Mon Sep 17 00:00:00 2001 From: jackpoz Date: Sat, 25 Jan 2014 21:28:01 +0100 Subject: [PATCH 08/25] Core/Calendar: Crash fix Attempt to fix #11512 crash by adding a NULL check since GetEvent() can return NULL. --- src/server/game/Calendar/CalendarMgr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index f7a6864fb95..52ed50f3948 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -340,7 +340,8 @@ CalendarEventStore CalendarMgr::GetPlayerEvents(uint64 guid) for (CalendarEventInviteStore::const_iterator itr = _invites.begin(); itr != _invites.end(); ++itr) for (CalendarInviteStore::const_iterator itr2 = itr->second.begin(); itr2 != itr->second.end(); ++itr2) if ((*itr2)->GetInviteeGUID() == guid) - events.insert(GetEvent(itr->first)); + if (CalendarEvent* event = GetEvent(itr->first)) // NULL check added as attempt to fix #11512 + events.insert(event); if (Player* player = ObjectAccessor::FindPlayer(guid)) for (CalendarEventStore::const_iterator itr = _events.begin(); itr != _events.end(); ++itr) From 68a0864ad1a73fe1972ba30bb3f5b9ba5e3de078 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sun, 26 Jan 2014 00:19:40 +0100 Subject: [PATCH 09/25] DB/SAI: Remove Obsolete SAI from Gordunni Proxy By dr-j closes #11207 --- sql/updates/world/2014_01_24_04_world_sai.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2014_01_24_04_world_sai.sql diff --git a/sql/updates/world/2014_01_24_04_world_sai.sql b/sql/updates/world/2014_01_24_04_world_sai.sql new file mode 100644 index 00000000000..6864160c2c5 --- /dev/null +++ b/sql/updates/world/2014_01_24_04_world_sai.sql @@ -0,0 +1,4 @@ +-- +UPDATE `creature_template` SET `AIName`= '' WHERE `entry`=23450; +DELETE FROM `smart_scripts` WHERE `entryorguid`=23450 AND `source_type`=0; +UPDATE `creature_template` SET `AIName`= '' WHERE `entry`=28674; From b40851744099f2858af70f9b13bb1ac850089482 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sun, 26 Jan 2014 00:26:01 +0100 Subject: [PATCH 10/25] DB/Quest: Dragonmaw Race: Wing Commander Ichman By Raszagal closes #11429 --- .../world/2014_01_24_05_world_creature_queststarter.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2014_01_24_05_world_creature_queststarter.sql diff --git a/sql/updates/world/2014_01_24_05_world_creature_queststarter.sql b/sql/updates/world/2014_01_24_05_world_creature_queststarter.sql new file mode 100644 index 00000000000..9b2893a859d --- /dev/null +++ b/sql/updates/world/2014_01_24_05_world_creature_queststarter.sql @@ -0,0 +1,4 @@ +-- Fixes the Dragonmaw Race: Wing Commander Ichman creature_queststarter mistake +UPDATE creature_template SET npcflag=3 WHERE entry=23345; +DELETE FROM creature_queststarter WHERE quest=11069; +INSERT INTO creature_queststarter VALUES (23345,11069); From f48eb0388db9ffda783af55b14f5a4c50326f8f0 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sun, 26 Jan 2014 00:31:40 +0100 Subject: [PATCH 11/25] DB/Loot: Felweed By SQLfix closes #11329 --- .../world/2014_01_24_06_world_gameobject_loot_template.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2014_01_24_06_world_gameobject_loot_template.sql diff --git a/sql/updates/world/2014_01_24_06_world_gameobject_loot_template.sql b/sql/updates/world/2014_01_24_06_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..3ca7a513409 --- /dev/null +++ b/sql/updates/world/2014_01_24_06_world_gameobject_loot_template.sql @@ -0,0 +1,3 @@ +-- +INSERT INTO `gameobject_loot_template` (`entry`, `item`, `ChanceOrQuestChance`) VALUES +(18111, 22795, 10); From 784ebb891ae8202b9848ccddf3f7f2026785369c Mon Sep 17 00:00:00 2001 From: Gacko Date: Sun, 26 Jan 2014 00:31:17 +0100 Subject: [PATCH 12/25] Tools: Fix build for Mac ACE_thread_t returned by ACE_Thread::self is a struct in Mac OS --- src/tools/mmaps_generator/MapBuilder.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/mmaps_generator/MapBuilder.cpp b/src/tools/mmaps_generator/MapBuilder.cpp index 805926defa0..aa02d76fe47 100644 --- a/src/tools/mmaps_generator/MapBuilder.cpp +++ b/src/tools/mmaps_generator/MapBuilder.cpp @@ -340,7 +340,9 @@ namespace MMAP /**************************************************************************/ void MapBuilder::buildMap(uint32 mapID) { +#ifndef __APPLE__ printf("[Thread %u] Building map %03u:\n", uint32(ACE_Thread::self()), mapID); +#endif std::set* tiles = getTileList(mapID); From bc63c3355010bc8991e6a99c9e0be6ff4fcde79a Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sun, 26 Jan 2014 00:46:51 +0100 Subject: [PATCH 13/25] DB/SAI: Fix Highlord Demitrian By Raszagal closes #11436 --- sql/updates/world/2014_01_24_07_world_sai.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2014_01_24_07_world_sai.sql diff --git a/sql/updates/world/2014_01_24_07_world_sai.sql b/sql/updates/world/2014_01_24_07_world_sai.sql new file mode 100644 index 00000000000..c1c00091be9 --- /dev/null +++ b/sql/updates/world/2014_01_24_07_world_sai.sql @@ -0,0 +1,3 @@ +-- Fixes to Highlord Demitrian smart_scripts +UPDATE smart_scripts SET `comment`='Highlord Demitrian - On Gossip Complete - Add Item Vessel of Rebirth' WHERE entryorguid=14347 AND event_type=62; +UPDATE smart_scripts SET action_param2=6, action_param3=60000, target_type=8, target_x='-6241.771973',target_y='1717.143311',target_z='4.250421',target_o='0.680879',`comment`='Highlord Demitrian - On Quest Thunderaan the Windseeker Finished - Summon Creature Prince Thunderaan at XYZO' WHERE entryorguid=14347 AND event_type=20; From 3c0b906a864911ca1ce41e13ce0fc776952f478c Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sun, 26 Jan 2014 00:57:08 +0100 Subject: [PATCH 14/25] DB/SAI: The Power of the Elements By dr-j and untaught, closes #6479 --- sql/updates/world/2014_01_26_00_world_sai.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 sql/updates/world/2014_01_26_00_world_sai.sql diff --git a/sql/updates/world/2014_01_26_00_world_sai.sql b/sql/updates/world/2014_01_26_00_world_sai.sql new file mode 100644 index 00000000000..671b0f081ba --- /dev/null +++ b/sql/updates/world/2014_01_26_00_world_sai.sql @@ -0,0 +1,13 @@ +-- +DELETE FROM `smart_scripts` WHERE `entryorguid`=24601 AND `id`=2; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(24601, 0, 2, 0, 6, 0, 100, 0, 0, 0, 0, 0, 33, 25987, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Steam Rager - On Death - Kill Credit'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry` =24601; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(22,3,24601,0,0,1,1,46374,0,0,0,0,'','Windsoul Totem Credit only if aura present at death'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=46374; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13,1,46374,0,0,31,0,3,24601,0,0,0,0,'','Windsoul Totem Aura targets only Steam Rager'), +(13,1,46374,0,0,36,0,0,0,0,0,0,0,'','Windsoul Totem Aura targets only alive units'); From 798bbc31f09c2d8c53450e30c02f00be25198e4b Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sun, 26 Jan 2014 00:59:53 +0100 Subject: [PATCH 15/25] DB/SAI: Blast the Infernals! By dr-j, closes #11428 --- sql/updates/world/2014_01_26_01_world_sai.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 sql/updates/world/2014_01_26_01_world_sai.sql diff --git a/sql/updates/world/2014_01_26_01_world_sai.sql b/sql/updates/world/2014_01_26_01_world_sai.sql new file mode 100644 index 00000000000..b585b4a0547 --- /dev/null +++ b/sql/updates/world/2014_01_26_01_world_sai.sql @@ -0,0 +1,10 @@ +-- +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=37056; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 37056, 0, 0, 31, 0, 3, 21316, 0, 0, 0, '','Kill Legion Hold Infernals Targets Deathforged Infernal'); + +UPDATE `creature_template` SET `ainame`='SmartAI' WHERE `entry`=21512; +DELETE FROM `smart_scripts` WHERE `entryorguid`=21512 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(21512,0,0,1,8,0,100,0,37055,0,300000,300000,33,21512,0,0,0,0,0,7,0,0,0,0,0,0,0,'Invis Legion Hold Glyph - On Spellhit (Destroy Legion Hold Infernals) - Give Kill Credit'), +(21512,0,1,0,61,0,100,0,37055,0,0,0,11,37056,0,0,0,0,0,1,0,0,0,0,0,0,0,'Invis Legion Hold Glyph - Linked with Previous Event - Cast Kill Legion Hold Infernals'); From 96060bf0078441e779c4cfcaa80f66ac5e97a3ff Mon Sep 17 00:00:00 2001 From: joschiwald Date: Sun, 26 Jan 2014 01:02:20 +0100 Subject: [PATCH 16/25] Core/Spells: move some spells so spellscripts --- .../world/2014_01_26_01_world_spells.sql | 7 ++ src/server/game/Entities/Unit/Unit.cpp | 38 ++----- src/server/game/Entities/Unit/Unit.h | 24 ++++- src/server/game/Spells/Spell.cpp | 75 +++++--------- src/server/scripts/Spells/spell_druid.cpp | 60 ++++++++++++ src/server/scripts/Spells/spell_generic.cpp | 59 +++++++++-- src/server/scripts/Spells/spell_rogue.cpp | 5 +- src/server/scripts/Spells/spell_warrior.cpp | 98 +++++++++++++++++-- 8 files changed, 265 insertions(+), 101 deletions(-) create mode 100644 sql/updates/world/2014_01_26_01_world_spells.sql diff --git a/sql/updates/world/2014_01_26_01_world_spells.sql b/sql/updates/world/2014_01_26_01_world_spells.sql new file mode 100644 index 00000000000..ff00f9eddcb --- /dev/null +++ b/sql/updates/world/2014_01_26_01_world_spells.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (58387,20230,-48438); +INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES +(58387, 'spell_warr_glyph_of_sunder_armor'), +(20230, 'spell_warr_retaliation'), +(-48438,'spell_dru_wild_growth'); + +DELETE FROM `spell_proc_event` WHERE `entry`=58387; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e7e29fe2588..cc0b338de3f 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5668,17 +5668,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere break; } } - - // Retaliation - if (dummySpell->SpellFamilyFlags[1] & 0x8) - { - // check attack comes not from behind - if (!HasInArc(M_PI, victim) || HasUnitState(UNIT_STATE_STUNNED)) - return false; - - triggered_spell_id = 22858; - break; - } // Second Wind if (dummySpell->SpellIconID == 1697) { @@ -5708,19 +5697,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = 58374; break; } - // Glyph of Sunder Armor - if (dummySpell->Id == 58387) - { - if (!victim || !victim->IsAlive() || !procSpell) - return false; - - target = SelectNearbyTarget(victim); - if (!target) - return false; - - triggered_spell_id = 58567; - break; - } break; } case SPELLFAMILY_WARLOCK: @@ -9365,9 +9341,7 @@ void Unit::SetMinion(Minion *minion, bool apply) } if (minion->m_Properties && minion->m_Properties->Type == SUMMON_TYPE_MINIPET) - { SetCritterGUID(minion->GetGUID()); - } // PvP, FFAPvP minion->SetByteValue(UNIT_FIELD_BYTES_2, 1, GetByteValue(UNIT_FIELD_BYTES_2, 1)); @@ -13274,12 +13248,14 @@ void Unit::SetLevel(uint8 lvl) { SetUInt32Value(UNIT_FIELD_LEVEL, lvl); - // group update - if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->GetGroup()) - ToPlayer()->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_LEVEL); + if (Player* player = ToPlayer()) + { + // group update + if (player->GetGroup()) + player->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_LEVEL); - if (GetTypeId() == TYPEID_PLAYER) - sWorld->UpdateCharacterNameDataLevel(ToPlayer()->GetGUIDLow(), lvl); + sWorld->UpdateCharacterNameDataLevel(GetGUIDLow(), lvl); + } } void Unit::SetHealth(uint32 val) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index bae10abe85b..41b181e54f8 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2261,12 +2261,23 @@ namespace Trinity { public: PowerPctOrderPred(Powers power, bool ascending = true) : _power(power), _ascending(ascending) { } - bool operator() (Unit const* a, Unit const* b) const + + bool operator()(WorldObject const* objA, WorldObject const* objB) const + { + Unit const* a = objA->ToUnit(); + Unit const* b = objB->ToUnit(); + float rA = (a && a->GetMaxPower(_power)) ? float(a->GetPower(_power)) / float(a->GetMaxPower(_power)) : 0.0f; + float rB = (b && b->GetMaxPower(_power)) ? float(b->GetPower(_power)) / float(b->GetMaxPower(_power)) : 0.0f; + return _ascending ? rA < rB : rA > rB; + } + + bool operator()(Unit const* a, Unit const* b) const { float rA = a->GetMaxPower(_power) ? float(a->GetPower(_power)) / float(a->GetMaxPower(_power)) : 0.0f; float rB = b->GetMaxPower(_power) ? float(b->GetPower(_power)) / float(b->GetMaxPower(_power)) : 0.0f; return _ascending ? rA < rB : rA > rB; } + private: Powers const _power; bool const _ascending; @@ -2277,12 +2288,23 @@ namespace Trinity { public: HealthPctOrderPred(bool ascending = true) : _ascending(ascending) { } + + bool operator()(WorldObject const* objA, WorldObject const* objB) const + { + Unit const* a = objA->ToUnit(); + Unit const* b = objB->ToUnit(); + float rA = (a && a->GetMaxHealth()) ? float(a->GetHealth()) / float(a->GetMaxHealth()) : 0.0f; + float rB = (b && b->GetMaxHealth()) ? float(b->GetHealth()) / float(b->GetMaxHealth()) : 0.0f; + return _ascending ? rA < rB : rA > rB; + } + bool operator() (Unit const* a, Unit const* b) const { float rA = a->GetMaxHealth() ? float(a->GetHealth()) / float(a->GetMaxHealth()) : 0.0f; float rB = b->GetMaxHealth() ? float(b->GetHealth()) / float(b->GetMaxHealth()) : 0.0f; return _ascending ? rA < rB : rA > rB; } + private: bool const _ascending; }; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 08e0323b491..3c2e06bb631 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1276,17 +1276,6 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge maxSize = m_spellInfo->MaxAffectedTargets; power = POWER_HEALTH; break; - case 57669: // Replenishment - // In arenas Replenishment may only affect the caster - if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->InArena()) - { - unitTargets.clear(); - unitTargets.push_back(m_caster); - break; - } - maxSize = 10; - power = POWER_MANA; - break; default: break; } @@ -1319,22 +1308,6 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge ++itr; } break; - case SPELLFAMILY_DRUID: - if (m_spellInfo->SpellFamilyFlags[1] == 0x04000000) // Wild Growth - { - maxSize = m_caster->HasAura(62970) ? 6 : 5; // Glyph of Wild Growth - power = POWER_HEALTH; - } - else - break; - - // Remove targets outside caster's raid - for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end();) - if (!(*itr)->IsInRaidWith(m_caster)) - itr = unitTargets.erase(itr); - else - ++itr; - break; default: break; } @@ -1427,33 +1400,33 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici break; case TARGET_DEST_CASTER_FISHING: { - float min_dis = m_spellInfo->GetMinRange(true); - float max_dis = m_spellInfo->GetMaxRange(true); - float dis = (float)rand_norm() * (max_dis - min_dis) + min_dis; - float x, y, z, angle; - angle = (float)rand_norm() * static_cast(M_PI * 35.0f / 180.0f) - static_cast(M_PI * 17.5f / 180.0f); - m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE, dis, angle); + float minDist = m_spellInfo->GetMinRange(true); + float maxDist = m_spellInfo->GetMaxRange(true); + float dist = frand(minDist, maxDist); + float x, y, z, angle; + float angle = float(rand_norm()) * static_cast(M_PI * 35.0f / 180.0f) - static_cast(M_PI * 17.5f / 180.0f); + m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE, dis, angle); - float ground = z; - float liquidLevel = m_caster->GetMap()->GetWaterOrGroundLevel(x, y, z, &ground); - if (liquidLevel <= ground) // When there is no liquid Map::GetWaterOrGroundLevel returns ground level - { - SendCastResult(SPELL_FAILED_NOT_HERE); - SendChannelUpdate(0); - finish(false); - return; - } + float ground = z; + float liquidLevel = m_caster->GetMap()->GetWaterOrGroundLevel(x, y, z, &ground); + if (liquidLevel <= ground) // When there is no liquid Map::GetWaterOrGroundLevel returns ground level + { + SendCastResult(SPELL_FAILED_NOT_HERE); + SendChannelUpdate(0); + finish(false); + return; + } - if (ground + 0.75 > liquidLevel) - { - SendCastResult(SPELL_FAILED_TOO_SHALLOW); - SendChannelUpdate(0); - finish(false); - return; - } + if (ground + 0.75 > liquidLevel) + { + SendCastResult(SPELL_FAILED_TOO_SHALLOW); + SendChannelUpdate(0); + finish(false); + return; + } - dest = SpellDestination(x, y, liquidLevel, m_caster->GetOrientation()); - break; + dest = SpellDestination(x, y, liquidLevel, m_caster->GetOrientation()); + break; } default: { diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 9fd43807fd5..79aa334d432 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -993,6 +993,65 @@ class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader } }; +class RaidCheck +{ + public: + explicit RaidCheck(Unit const* caster) : _caster(caster) { } + + bool operator()(WorldObject* obj) const + { + if (Unit* target = obj->ToUnit()) + return !_caster->IsInRaidWith(target); + + return true; + } + + private: + Unit const* _caster; +}; + +// -48438 - Wild Growth +class spell_dru_wild_growth : public SpellScriptLoader +{ + public: + spell_dru_wild_growth() : SpellScriptLoader("spell_dru_wild_growth") { } + + class spell_dru_wild_growth_SpellScript : public SpellScript + { + PrepareSpellScript(spell_dru_wild_growth_SpellScript); + + bool Validate(SpellInfo const* spellInfo) OVERRIDE + { + if (spellInfo->Effects[EFFECT_2].IsEffect() || !spellInfo->Effects[EFFECT_2].CalcValue()) + return false; + return true; + } + + void FilterTargets(std::list& targets) + { + targets.remove_if(RaidCheck(GetCaster())); + + int32 const maxTargets = GetSpellInfo()->Effects[EFFECT_2].CalcValue(GetCaster()); + + if (targets.size() > maxTargets) + { + targets.sort(Trinity::HealthPctOrderPred()); + targets.resize(maxTargets); + } + } + + void Register() OVERRIDE + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dru_wild_growth_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_dru_wild_growth_SpellScript(); + } +}; + void AddSC_druid_spell_scripts() { new spell_dru_dash(); @@ -1018,4 +1077,5 @@ void AddSC_druid_spell_scripts() new spell_dru_tiger_s_fury(); new spell_dru_typhoon(); new spell_dru_t10_restoration_4p_bonus(); + new spell_dru_wild_growth(); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 3feb9821177..1e9a8713019 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2963,23 +2963,66 @@ enum Replenishment SPELL_INFINITE_REPLENISHMENT = 61782 }; +class ReplenishmentCheck +{ +public: + bool operator()(WorldObject* obj) const + { + if (Unit* target = obj->ToUnit()) + return target->getPowerType() != POWER_MANA; + + return true; + } +}; + class spell_gen_replenishment : public SpellScriptLoader { public: spell_gen_replenishment() : SpellScriptLoader("spell_gen_replenishment") { } + class spell_gen_replenishment_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_replenishment_SpellScript); + + void RemoveInvalidTargets(std::list& targets) + { + // In arenas Replenishment may only affect the caster + if (Player* caster = GetCaster()->ToPlayer()) + { + if (caster->InArena()) + { + targets.clear(); + targets.push_back(caster); + return; + } + } + + targets.remove_if(ReplenishmentCheck()); + + uint8 const maxTargets = 10; + + if (targets.size() > maxTargets) + { + targets.sort(Trinity::PowerPctOrderPred(POWER_MANA)); + targets.resize(maxTargets); + } + } + + void Register() OVERRIDE + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gen_replenishment_SpellScript::RemoveInvalidTargets, EFFECT_ALL, TARGET_UNIT_CASTER_AREA_RAID); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_gen_replenishment_SpellScript(); + } + class spell_gen_replenishment_AuraScript : public AuraScript { PrepareAuraScript(spell_gen_replenishment_AuraScript); - bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE - { - if (!sSpellMgr->GetSpellInfo(SPELL_REPLENISHMENT) || - !sSpellMgr->GetSpellInfo(SPELL_INFINITE_REPLENISHMENT)) - return false; - return true; - } - bool Load() OVERRIDE { return GetUnitOwner()->GetPower(POWER_MANA); diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index b8b652eb314..d1d43684f3e 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -255,10 +255,11 @@ class spell_rog_deadly_poison : public SpellScriptLoader }; // 51690 - Killing Spree +#define KillingSpreeScriptName "spell_rog_killing_spree" class spell_rog_killing_spree : public SpellScriptLoader { public: - spell_rog_killing_spree() : SpellScriptLoader("spell_rog_killing_spree") { } + spell_rog_killing_spree() : SpellScriptLoader(KillingSpreeScriptName) { } class spell_rog_killing_spree_SpellScript : public SpellScript { @@ -274,7 +275,7 @@ class spell_rog_killing_spree : public SpellScriptLoader { if (Aura* aura = GetCaster()->GetAura(SPELL_ROGUE_KILLING_SPREE)) { - if (spell_rog_killing_spree_AuraScript* script = dynamic_cast(aura->GetScriptByName("spell_rog_killing_spree"))) + if (spell_rog_killing_spree_AuraScript* script = dynamic_cast(aura->GetScriptByName(KillingSpreeScriptName))) script->AddTarget(GetHitUnit()); } } diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index cafe510cc4f..5a655a92996 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -42,7 +42,9 @@ enum WarriorSpells SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF = 65156, SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT = 64976, SPELL_WARRIOR_LAST_STAND_TRIGGERED = 12976, + SPELL_WARRIOR_RETALIATION_DAMAGE = 22858, SPELL_WARRIOR_SLAM = 50783, + SPELL_WARRIOR_SUNDER_ARMOR = 58567, SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK = 26654, SPELL_WARRIOR_TAUNT = 355, SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_1 = 46859, @@ -53,6 +55,11 @@ enum WarriorSpells SPELL_WARRIOR_VIGILANCE_REDIRECT_THREAT = 59665 }; +enum WarriorSpellIcons +{ + WARRIOR_ICON_ID_SUDDEN_DEATH = 1989 +}; + enum MiscSpells { SPELL_PALADIN_BLESSING_OF_SANCTUARY = 20911, @@ -61,11 +68,6 @@ enum MiscSpells SPELL_GEN_DAMAGE_REDUCTION_AURA = 68066, }; -enum WarriorSpellIcons -{ - WARRIOR_ICON_ID_SUDDEN_DEATH = 1989 -}; - // 23881 - Bloodthirst class spell_warr_bloodthirst : public SpellScriptLoader { @@ -313,7 +315,7 @@ class spell_warr_execute : public SpellScriptLoader return true; } - void HandleDummy(SpellEffIndex effIndex) + void HandleEffect(SpellEffIndex effIndex) { Unit* caster = GetCaster(); if (Unit* target = GetHitUnit()) @@ -342,7 +344,7 @@ class spell_warr_execute : public SpellScriptLoader void Register() OVERRIDE { - OnEffectHitTarget += SpellEffectFn(spell_warr_execute_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_warr_execute_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_DUMMY); } }; @@ -352,6 +354,42 @@ class spell_warr_execute : public SpellScriptLoader } }; +// 58387 - Glyph of Sunder Armor +class spell_warr_glyph_of_sunder_armor : public SpellScriptLoader +{ + public: + spell_warr_glyph_of_sunder_armor() : SpellScriptLoader("spell_warr_glyph_of_sunder_armor") { } + + class spell_warr_glyph_of_sunder_armor_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warr_glyph_of_sunder_armor_AuraScript); + + void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod) + { + if (!spellMod) + { + spellMod = new SpellModifier(aurEff->GetBase()); + spellMod->op = SpellModOp(aurEff->GetMiscValue()); + spellMod->type = SPELLMOD_FLAT; + spellMod->spellId = GetId(); + spellMod->mask = GetSpellInfo()->Effects[aurEff->GetEffIndex()].SpellClassMask; + } + + spellMod->value = aurEff->GetAmount(); + } + + void Register() OVERRIDE + { + DoEffectCalcSpellMod += AuraEffectCalcSpellModFn(spell_warr_glyph_of_sunder_armor_AuraScript::HandleEffectCalcSpellMod, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_warr_glyph_of_sunder_armor_AuraScript(); + } +}; + // 59725 - Improved Spell Reflection class spell_warr_improved_spell_reflection : public SpellScriptLoader { @@ -528,6 +566,48 @@ class spell_warr_rend : public SpellScriptLoader } }; +// 20230 - Retaliation +class spell_warr_retaliation : public SpellScriptLoader +{ + public: + spell_warr_retaliation() : SpellScriptLoader("spell_warr_retaliation") { } + + class spell_warr_retaliation_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warr_retaliation_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_RETALIATION_DAMAGE)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + // check attack comes not from behind and warrior is not stunned + return GetTarget()->isInFront(eventInfo.GetActor(), M_PI) && !GetTarget()->HasUnitState(UNIT_STATE_STUNNED); + } + + void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_WARRIOR_RETALIATION_DAMAGE, true, NULL, aurEff); + } + + void Register() OVERRIDE + { + DoCheckProc += AuraCheckProcFn(spell_warr_retaliation_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_warr_retaliation_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_warr_retaliation_AuraScript(); + } +}; + // 64380, 65941 - Shattering Throw class spell_warr_shattering_throw : public SpellScriptLoader { @@ -739,7 +819,7 @@ class spell_warr_vigilance : public SpellScriptLoader } }; -// 50725 Vigilance +// 50725 - Vigilance class spell_warr_vigilance_trigger : public SpellScriptLoader { public: @@ -779,11 +859,13 @@ void AddSC_warrior_spell_scripts() new spell_warr_damage_shield(); new spell_warr_deep_wounds(); new spell_warr_execute(); + new spell_warr_glyph_of_sunder_armor(); new spell_warr_improved_spell_reflection(); new spell_warr_intimidating_shout(); new spell_warr_last_stand(); new spell_warr_overpower(); new spell_warr_rend(); + new spell_warr_retaliation(); new spell_warr_shattering_throw(); new spell_warr_slam(); new spell_warr_sweeping_strikes(); From 527d0541f60a8623cc18f88726c634a27d34eb21 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sun, 26 Jan 2014 01:02:35 +0100 Subject: [PATCH 17/25] DB/SAI: Fix freed from the Hive By dr-j, closes #11438 --- sql/updates/world/2014_01_26_02_world_sai.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 sql/updates/world/2014_01_26_02_world_sai.sql diff --git a/sql/updates/world/2014_01_26_02_world_sai.sql b/sql/updates/world/2014_01_26_02_world_sai.sql new file mode 100644 index 00000000000..81d52f8e9e2 --- /dev/null +++ b/sql/updates/world/2014_01_26_02_world_sai.sql @@ -0,0 +1,12 @@ +-- +UPDATE `smart_scripts` SET `event_type`=11 WHERE `entryorguid`=9546 AND `source_type`=0 AND `id`=0; +UPDATE `smart_scripts` SET `target_type`=12, `target_param1`=1 WHERE `entryorguid`=954600 AND `source_type`=9 AND `id`=2; + +DELETE FROM `smart_scripts` WHERE `entryorguid`=164954 AND `source_type`=1; +DELETE FROM `smart_scripts` WHERE `entryorguid`=16495400 AND `source_type`=9; + +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(164954,1,0,1,19,0,100,0,4265,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0,"Zukk'ash Pod - On Quest Accept - Store Target List"), +(164954,1,1,2,61,0,100,0,0,0,0,0,12,9546,1,25000,0,0,0,8,0,0,0,-5314.81,430.89,11.79,3.46,"Zukk'ash Pod - On Quest Accept - Summon Raschal the Courier"), +(164954,1,2,0,61,0,100,0,0,0,0,0,80,16495400,2,0,0,0,0,1,0,0,0,0,0,0,0,"Zukk'ash Pod - On Quest Accept - Run Script"), +(16495400,9,0,0,0,0,100,0,100,100,0,0,100,1,0,0,0,0,0,19,9546,0,0,0,0,0,0,"Zukk'ash Pod - Script - Send Target List to Raschal the Courier"); From 744d6f13271af8ce36265617f02de223bd206cad Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sun, 26 Jan 2014 01:06:53 +0100 Subject: [PATCH 18/25] DB/SAI:Emergency Protocol: Section 8.2, Paragraph D By dr-j, closes #11206 --- sql/updates/world/2014_01_26_04_world_sai.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sql/updates/world/2014_01_26_04_world_sai.sql diff --git a/sql/updates/world/2014_01_26_04_world_sai.sql b/sql/updates/world/2014_01_26_04_world_sai.sql new file mode 100644 index 00000000000..0ca7e70159d --- /dev/null +++ b/sql/updates/world/2014_01_26_04_world_sai.sql @@ -0,0 +1,18 @@ +-- [11796] Emergency Protocol: Section 8.2, Paragraph D +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry` IN(25845,25846,25847); + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (25845,25846,25847); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(25845, 0, 0, 0, 8, 0, 100, 0, 46171, 0, 0, 0, 33, 25845 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Northwest Crash - On Spellhit - Kill Credit'), +(25846, 0, 0, 0, 8, 0, 100, 0, 46171, 0, 0, 0, 33, 25846 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'South Crash - On Spellhit - Kill Credit'), +(25847, 0, 0, 0, 8, 0, 100, 0, 46171, 0, 0, 0, 33, 25847 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'East Crash - On Spellhit - Kill Credit'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=46171; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13,1,46171,0,0,31,0,3,25845,0,0,0,0,'','Scuttle Wrecked Flying Machine targets Northwest Crash'), +(13,1,46171,0,1,31,0,3,25846,0,0,0,0,'','Scuttle Wrecked Flying Machine targets South Crash'), +(13,1,46171,0,2,31,0,3,25847,0,0,0,0,'','Scuttle Wrecked Flying Machine Flare targets East Crash'); + +DELETE FROM `disables` WHERE `sourceType`=0 AND `entry`=46171; +INSERT INTO `disables` (`sourceType`, `entry`, `flags`, `params_0`, `params_1`, `comment`) VALUES +(0, 46171, 64, '', '', 'Ignore LOS on Scuttle Wrecked Flying Machine'); From 5c36a50ed44a251bb92363fade5705c11f03dcbb Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sun, 26 Jan 2014 01:11:45 +0100 Subject: [PATCH 19/25] DB/SAI: The Earthen Oath By dr-j closes #6966 --- sql/updates/world/2014_01_26_05_world_sai.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 sql/updates/world/2014_01_26_05_world_sai.sql diff --git a/sql/updates/world/2014_01_26_05_world_sai.sql b/sql/updates/world/2014_01_26_05_world_sai.sql new file mode 100644 index 00000000000..9f4b1092532 --- /dev/null +++ b/sql/updates/world/2014_01_26_05_world_sai.sql @@ -0,0 +1,15 @@ +-- +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 29978; + +DELETE FROM `smart_scripts` WHERE `entryorguid`=29978; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(29978, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 33, 30297, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Iron Dwarf Assailant - On Death - Give Kill credit'); + +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 29984; + +DELETE FROM `smart_scripts` WHERE `entryorguid`=29984; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(29984, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 33, 30296, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Iron Sentinel - On Death - Give Kill credit'), +(29984, 0, 1, 0, 9, 0, 100, 0, 0,10, 12000, 24000, 11, 56490, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Iron Sentinel - On Range - Cast Stomp'), +(29984, 0, 2, 0, 0, 0, 100, 0, 0, 3000, 5000, 8000, 11, 55811, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Iron Sentinel - IC - Cast Throw Bolder'), +(29984, 0, 3, 0, 9, 0, 100, 0, 0, 5, 5000, 7000, 11, 5568, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Iron Sentinel - IC - Cast Trample'); From fbddda52e7c899966cbe60c776a6d920650ee998 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Sun, 26 Jan 2014 02:24:57 +0100 Subject: [PATCH 20/25] Core/Spells: move more spells to spellscripts --- ...lls.sql => 2014_01_26_06_world_spells.sql} | 0 ...2014_01_26_07_world_spell_script_names.sql | 8 + src/server/game/Spells/Spell.cpp | 121 ++------------ src/server/scripts/Spells/spell_item.cpp | 35 ++++ src/server/scripts/Spells/spell_paladin.cpp | 34 ++++ src/server/scripts/Spells/spell_priest.cpp | 151 ++++++++++++++++++ src/server/scripts/Spells/spell_shaman.cpp | 13 ++ 7 files changed, 250 insertions(+), 112 deletions(-) rename sql/updates/world/{2014_01_26_01_world_spells.sql => 2014_01_26_06_world_spells.sql} (100%) create mode 100644 sql/updates/world/2014_01_26_07_world_spell_script_names.sql diff --git a/sql/updates/world/2014_01_26_01_world_spells.sql b/sql/updates/world/2014_01_26_06_world_spells.sql similarity index 100% rename from sql/updates/world/2014_01_26_01_world_spells.sql rename to sql/updates/world/2014_01_26_06_world_spells.sql diff --git a/sql/updates/world/2014_01_26_07_world_spell_script_names.sql b/sql/updates/world/2014_01_26_07_world_spell_script_names.sql new file mode 100644 index 00000000000..b0809b98ece --- /dev/null +++ b/sql/updates/world/2014_01_26_07_world_spell_script_names.sql @@ -0,0 +1,8 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (-34861,64844,64904,54968,71610,71641); +INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES +(-34861,'spell_pri_circle_of_healing'), +(64844, 'spell_pri_divine_hymn'), +(64904, 'spell_pri_hymn_of_hope'), +(54968, 'spell_pal_glyph_of_holy_light'), +(71610, 'spell_item_echoes_of_light'), +(71641, 'spell_item_echoes_of_light'); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 3c2e06bb631..e72a1da563e 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1244,100 +1244,8 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge CallScriptObjectAreaTargetSelectHandlers(targets, effIndex); - std::list unitTargets; - std::list gObjTargets; - // for compability with older code - add only unit and go targets - /// @todo remove this - for (std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr) + if (!targets.empty()) { - if (Unit* unitTarget = (*itr)->ToUnit()) - unitTargets.push_back(unitTarget); - else if (GameObject* gObjTarget = (*itr)->ToGameObject()) - gObjTargets.push_back(gObjTarget); - } - - if (!unitTargets.empty()) - { - // Special target selection for smart heals and energizes - uint32 maxSize = 0; - int32 power = -1; - switch (m_spellInfo->SpellFamilyName) - { - case SPELLFAMILY_GENERIC: - switch (m_spellInfo->Id) - { - case 52759: // Ancestral Awakening - case 71610: // Echoes of Light (Althor's Abacus normal version) - case 71641: // Echoes of Light (Althor's Abacus heroic version) - maxSize = 1; - power = POWER_HEALTH; - break; - case 54968: // Glyph of Holy Light - maxSize = m_spellInfo->MaxAffectedTargets; - power = POWER_HEALTH; - break; - default: - break; - } - break; - case SPELLFAMILY_PRIEST: - if (m_spellInfo->SpellFamilyFlags[0] == 0x10000000) // Circle of Healing - { - maxSize = m_caster->HasAura(55675) ? 6 : 5; // Glyph of Circle of Healing - power = POWER_HEALTH; - } - else if (m_spellInfo->Id == 64844) // Divine Hymn - { - maxSize = 3; - power = POWER_HEALTH; - } - else if (m_spellInfo->Id == 64904) // Hymn of Hope - { - maxSize = 3; - power = POWER_MANA; - } - else - break; - - // Remove targets outside caster's raid - for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end();) - { - if (!(*itr)->IsInRaidWith(m_caster)) - itr = unitTargets.erase(itr); - else - ++itr; - } - break; - default: - break; - } - - if (maxSize && power != -1) - { - if (Powers(power) == POWER_HEALTH) - { - if (unitTargets.size() > maxSize) - { - unitTargets.sort(Trinity::HealthPctOrderPred()); - unitTargets.resize(maxSize); - } - } - else - { - for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end();) - if ((*itr)->getPowerType() != (Powers)power) - itr = unitTargets.erase(itr); - else - ++itr; - - if (unitTargets.size() > maxSize) - { - unitTargets.sort(Trinity::PowerPctOrderPred((Powers)power)); - unitTargets.resize(maxSize); - } - } - } - // Other special target selection goes here if (uint32 maxTargets = m_spellValue->MaxAffectedTargets) { @@ -1346,27 +1254,16 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge if ((*j)->IsAffectedOnSpell(m_spellInfo)) maxTargets += (*j)->GetAmount(); - Trinity::Containers::RandomResizeList(unitTargets, maxTargets); + Trinity::Containers::RandomResizeList(targets, maxTargets); } - for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr) - AddUnitTarget(*itr, effMask, false); - } - - if (!gObjTargets.empty()) - { - if (uint32 maxTargets = m_spellValue->MaxAffectedTargets) + for (std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr) { - Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS); - for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j) - if ((*j)->IsAffectedOnSpell(m_spellInfo)) - maxTargets += (*j)->GetAmount(); - - Trinity::Containers::RandomResizeList(gObjTargets, maxTargets); + if (Unit* unitTarget = (*itr)->ToUnit()) + AddUnitTarget(unitTarget, effMask, false); + else if (GameObject* gObjTarget = (*itr)->ToGameObject()) + AddGOTarget(gObjTarget, effMask); } - - for (std::list::iterator itr = gObjTargets.begin(); itr != gObjTargets.end(); ++itr) - AddGOTarget(*itr, effMask); } } @@ -1403,9 +1300,9 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici float minDist = m_spellInfo->GetMinRange(true); float maxDist = m_spellInfo->GetMaxRange(true); float dist = frand(minDist, maxDist); - float x, y, z, angle; + float x, y, z; float angle = float(rand_norm()) * static_cast(M_PI * 35.0f / 180.0f) - static_cast(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, dist, angle); float ground = z; float liquidLevel = m_caster->GetMap()->GetWaterOrGroundLevel(x, y, z, &ground); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 8b3716f8f7d..837023f3bdd 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -349,6 +349,40 @@ class spell_item_deviate_fish : public SpellScriptLoader } }; +// 71610, 71641 - Echoes of Light (Althor's Abacus) +class spell_item_echoes_of_light : public SpellScriptLoader +{ + public: + spell_item_echoes_of_light() : SpellScriptLoader("spell_item_echoes_of_light") { } + + class spell_item_echoes_of_light_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_echoes_of_light_SpellScript); + + void FilterTargets(std::list& targets) + { + if (targets.size() < 2) + return; + + targets.sort(Trinity::HealthPctOrderPred()); + + WorldObject* target = targets.front(); + targets.clear(); + targets.push_back(target); + } + + void Register() OVERRIDE + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_item_echoes_of_light_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_item_echoes_of_light_SpellScript(); + } +}; + // http://www.wowhead.com/item=47499 Flask of the North // 67019 Flask of the North enum FlaskOfTheNorthSpells @@ -2571,6 +2605,7 @@ void AddSC_item_spell_scripts() new spell_item_defibrillate("spell_item_gnomish_army_knife", 33); new spell_item_desperate_defense(); new spell_item_deviate_fish(); + new spell_item_echoes_of_light(); new spell_item_flask_of_the_north(); new spell_item_gnomish_death_ray(); new spell_item_make_a_wish(); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 0b790f01d29..6abe2fee1d3 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -564,6 +564,39 @@ class spell_pal_eye_for_an_eye : public SpellScriptLoader } }; +// 54968 - Glyph of Holy Light +class spell_pal_glyph_of_holy_light : public SpellScriptLoader +{ + public: + spell_pal_glyph_of_holy_light() : SpellScriptLoader("spell_pal_glyph_of_holy_light") { } + + class spell_pal_glyph_of_holy_light_SpellScript : public SpellScript + { + PrepareSpellScript(spell_pal_glyph_of_holy_light_SpellScript); + + void FilterTargets(std::list& targets) + { + uint32 const maxTargets = GetSpellInfo()->MaxAffectedTargets; + + if (targets.size() > maxTargets) + { + targets.sort(Trinity::HealthPctOrderPred()); + targets.resize(maxTargets); + } + } + + void Register() OVERRIDE + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pal_glyph_of_holy_light_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_pal_glyph_of_holy_light_SpellScript(); + } +}; + // 63521 - Guarded by The Light class spell_pal_guarded_by_the_light : public SpellScriptLoader { @@ -1142,6 +1175,7 @@ void AddSC_paladin_spell_scripts() new spell_pal_divine_storm_dummy(); new spell_pal_exorcism_and_holy_wrath_damage(); new spell_pal_eye_for_an_eye(); + new spell_pal_glyph_of_holy_light(); new spell_pal_guarded_by_the_light(); new spell_pal_hand_of_sacrifice(); new spell_pal_hand_of_salvation(); diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 4a702c7559c..377d012fea5 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -31,6 +31,7 @@ enum PriestSpells { SPELL_PRIEST_DIVINE_AEGIS = 47753, SPELL_PRIEST_EMPOWERED_RENEW = 63544, + SPELL_PRIEST_GLYPH_OF_CIRCLE_OF_HEALING = 55675, SPELL_PRIEST_GLYPH_OF_LIGHTWELL = 55673, SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL = 56161, SPELL_PRIEST_GUARDIAN_SPIRIT_HEAL = 48153, @@ -53,6 +54,82 @@ enum PriestSpellIcons PRIEST_ICON_ID_PAIN_AND_SUFFERING = 2874, }; +class PowerCheck +{ + public: + explicit PowerCheck(Powers power) : _power(power) { } + + bool operator()(WorldObject* obj) const + { + if (Unit* target = obj->ToUnit()) + return target->getPowerType() != _power; + + return true; + } + + private: + Powers _power; +}; + +class RaidCheck +{ + public: + explicit RaidCheck(Unit const* caster) : _caster(caster) { } + + bool operator()(WorldObject* obj) const + { + if (Unit* target = obj->ToUnit()) + return !_caster->IsInRaidWith(target); + + return true; + } + + private: + Unit const* _caster; +}; + +// -34861 - Circle of Healing +class spell_pri_circle_of_healing : public SpellScriptLoader +{ + public: + spell_pri_circle_of_healing() : SpellScriptLoader("spell_pri_circle_of_healing") { } + + class spell_pri_circle_of_healing_SpellScript : public SpellScript + { + PrepareSpellScript(spell_pri_circle_of_healing_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_GLYPH_OF_CIRCLE_OF_HEALING)) + return false; + return true; + } + + void FilterTargets(std::list& targets) + { + targets.remove_if(RaidCheck(GetCaster())); + + uint32 const maxTargets = GetCaster()->HasAura(SPELL_PRIEST_GLYPH_OF_CIRCLE_OF_HEALING) ? 6 : 5; // Glyph of Circle of Healing + + if (targets.size() > maxTargets) + { + targets.sort(Trinity::HealthPctOrderPred()); + targets.resize(maxTargets); + } + } + + void Register() OVERRIDE + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_circle_of_healing_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_pri_circle_of_healing_SpellScript(); + } +}; + // -47509 - Divine Aegis class spell_pri_divine_aegis : public SpellScriptLoader { @@ -103,6 +180,41 @@ class spell_pri_divine_aegis : public SpellScriptLoader } }; +// 64844 - Divine Hymn +class spell_pri_divine_hymn : public SpellScriptLoader +{ + public: + spell_pri_divine_hymn() : SpellScriptLoader("spell_pri_divine_hymn") { } + + class spell_pri_divine_hymn_SpellScript : public SpellScript + { + PrepareSpellScript(spell_pri_divine_hymn_SpellScript); + + void FilterTargets(std::list& targets) + { + targets.remove_if(RaidCheck(GetCaster())); + + uint32 const maxTargets = 3; + + if (targets.size() > maxTargets) + { + targets.sort(Trinity::HealthPctOrderPred()); + targets.resize(maxTargets); + } + } + + void Register() OVERRIDE + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_divine_hymn_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_pri_divine_hymn_SpellScript(); + } +}; + // 55680 - Glyph of Prayer of Healing class spell_pri_glyph_of_prayer_of_healing : public SpellScriptLoader { @@ -198,6 +310,42 @@ class spell_pri_guardian_spirit : public SpellScriptLoader } }; +// 64904 - Hymn of Hope +class spell_pri_hymn_of_hope : public SpellScriptLoader +{ + public: + spell_pri_hymn_of_hope() : SpellScriptLoader("spell_pri_hymn_of_hope") { } + + class spell_pri_hymn_of_hope_SpellScript : public SpellScript + { + PrepareSpellScript(spell_pri_hymn_of_hope_SpellScript); + + void FilterTargets(std::list& targets) + { + targets.remove_if(PowerCheck(POWER_MANA)); + targets.remove_if(RaidCheck(GetCaster())); + + uint32 const maxTargets = 3; + + if (targets.size() > maxTargets) + { + targets.sort(Trinity::PowerPctOrderPred(POWER_MANA)); + targets.resize(maxTargets); + } + } + + void Register() OVERRIDE + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_hymn_of_hope_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_pri_hymn_of_hope_SpellScript(); + } +}; + // 37594 - Greater Heal Refund class spell_pri_item_greater_heal_refund : public SpellScriptLoader { @@ -703,9 +851,12 @@ class spell_pri_vampiric_touch : public SpellScriptLoader void AddSC_priest_spell_scripts() { + new spell_pri_circle_of_healing(); new spell_pri_divine_aegis(); + new spell_pri_divine_hymn(); new spell_pri_glyph_of_prayer_of_healing(); new spell_pri_guardian_spirit(); + new spell_pri_hymn_of_hope(); new spell_pri_item_greater_heal_refund(); new spell_pri_lightwell_renew(); new spell_pri_mana_burn(); diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index c8fa5b3f1fe..707c8a0985f 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -79,6 +79,18 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader return true; } + void FilterTargets(std::list& targets) + { + if (targets.size() < 2) + return; + + targets.sort(Trinity::HealthPctOrderPred()); + + WorldObject* target = targets.front(); + targets.clear(); + targets.push_back(target); + } + void HandleDummy(SpellEffIndex /*effIndex*/) { int32 damage = GetEffectValue(); @@ -88,6 +100,7 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader void Register() OVERRIDE { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_ancestral_awakening_proc_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); OnEffectHitTarget += SpellEffectFn(spell_sha_ancestral_awakening_proc_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; From 955fb907c549fea0088f8c105714cc9fb931da15 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sun, 26 Jan 2014 03:48:33 +0100 Subject: [PATCH 21/25] Core: Fix warnings --- src/server/game/Entities/Player/Player.cpp | 24 +++++++++++----------- src/server/game/Entities/Unit/Unit.cpp | 10 +++++---- src/server/scripts/Spells/spell_dk.cpp | 8 ++++---- src/server/scripts/Spells/spell_druid.cpp | 2 +- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b324b5281f9..9ee7bc4b05a 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2634,38 +2634,38 @@ void Player::RegenerateHealth() if (getLevel() < 15) HealthIncreaseRate = sWorld->getRate(RATE_HEALTH) * (2.066f - (getLevel() * 0.066f)); - float addvalue = 0.0f; + float addValue = 0.0f; // polymorphed case if (IsPolymorphed()) - addvalue = (float)GetMaxHealth()/3; + addValue = float(GetMaxHealth()) / 3.0f; // normal regen case (maybe partly in combat case) else if (!IsInCombat() || HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT)) { - addvalue = OCTRegenHPPerSpirit() * HealthIncreaseRate; + addValue = OCTRegenHPPerSpirit() * HealthIncreaseRate; if (!IsInCombat()) { AuraEffectList const& mModHealthRegenPct = GetAuraEffectsByType(SPELL_AURA_MOD_HEALTH_REGEN_PERCENT); for (AuraEffectList::const_iterator i = mModHealthRegenPct.begin(); i != mModHealthRegenPct.end(); ++i) - AddPct(addvalue, (*i)->GetAmount()); + AddPct(addValue, (*i)->GetAmount()); - addvalue += GetTotalAuraModifier(SPELL_AURA_MOD_REGEN) * 2 * IN_MILLISECONDS / (5 * IN_MILLISECONDS); + addValue += GetTotalAuraModifier(SPELL_AURA_MOD_REGEN) * 0.4f; } else if (HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT)) - ApplyPct(addvalue, GetTotalAuraModifier(SPELL_AURA_MOD_REGEN_DURING_COMBAT)); + ApplyPct(addValue, GetTotalAuraModifier(SPELL_AURA_MOD_REGEN_DURING_COMBAT)); if (!IsStandState()) - addvalue *= 1.5f; + addValue *= 1.5f; } // always regeneration bonus (including combat) - addvalue += GetTotalAuraModifier(SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT); - addvalue += m_baseHealthRegen / 2.5f; + addValue += GetTotalAuraModifier(SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT); + addValue += m_baseHealthRegen / 2.5f; - if (addvalue < 0) - addvalue = 0; + if (addValue < 0.0f) + addValue = 0.0f; - ModifyHealth(int32(addvalue)); + ModifyHealth(int32(addValue)); } void Player::ResetAllPowers() diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index cc0b338de3f..e0bf7019acb 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17445,19 +17445,21 @@ bool Unit::SetHover(bool enable, bool /*packetOnly = false*/) if (enable == HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) return false; + float hoverHeight = GetFloatValue(UNIT_FIELD_HOVERHEIGHT); + if (enable) { //! No need to check height on ascent AddUnitMovementFlag(MOVEMENTFLAG_HOVER); - if (float hh = GetFloatValue(UNIT_FIELD_HOVERHEIGHT)) - UpdateHeight(GetPositionZ() + hh); + if (hoverHeight) + UpdateHeight(GetPositionZ() + hoverHeight); } else { RemoveUnitMovementFlag(MOVEMENTFLAG_HOVER); - if (float hh = GetFloatValue(UNIT_FIELD_HOVERHEIGHT)) + if (hoverHeight) { - float newZ = GetPositionZ() - hh; + float newZ = GetPositionZ() - hoverHeight; UpdateAllowedPositionZ(GetPositionX(), GetPositionY(), newZ); UpdateHeight(newZ); } diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index e1ef9ea6862..64a886cee8c 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -140,13 +140,13 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader absorbAmount = std::min(CalculatePct(dmgInfo.GetDamage(), absorbPct), GetTarget()->CountPctFromMaxHealth(hpPct)); } - void Trigger(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount) + void Trigger(AuraEffect* aurEff, DamageInfo& /*dmgInfo*/, uint32& absorbAmount) { - Unit* target = GetTarget(); // damage absorbed by Anti-Magic Shell energizes the DK with additional runic power. // This, if I'm not mistaken, shows that we get back ~20% of the absorbed damage as runic power. - int32 bp = absorbAmount * 2 / 10; - target->CastCustomSpell(target, SPELL_DK_RUNIC_POWER_ENERGIZE, &bp, NULL, NULL, true, NULL, aurEff); + absorbAmount = absorbAmount * 2 / 10; + + GetTarget()->CastCustomSpell(SPELL_DK_RUNIC_POWER_ENERGIZE, SPELLVALUE_BASE_POINT0, absorbAmount, GetTarget(), true, NULL, aurEff); } void Register() OVERRIDE diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 79aa334d432..482228fb649 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -1033,7 +1033,7 @@ class spell_dru_wild_growth : public SpellScriptLoader int32 const maxTargets = GetSpellInfo()->Effects[EFFECT_2].CalcValue(GetCaster()); - if (targets.size() > maxTargets) + if (targets.size() > uint32(maxTargets)) { targets.sort(Trinity::HealthPctOrderPred()); targets.resize(maxTargets); From 96ae4caf6258882cf89ff6d4bb3ac5aa0a3474f7 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sun, 26 Jan 2014 03:56:41 +0100 Subject: [PATCH 22/25] Core/Spells: Fix typo in 955fb907c549fea0088f8c105714cc9fb931da15 --- src/server/scripts/Spells/spell_dk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 64a886cee8c..035a17dd4bf 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -144,7 +144,7 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader { // damage absorbed by Anti-Magic Shell energizes the DK with additional runic power. // This, if I'm not mistaken, shows that we get back ~20% of the absorbed damage as runic power. - absorbAmount = absorbAmount * 2 / 10; + absorbAmount *= 0.2f; GetTarget()->CastCustomSpell(SPELL_DK_RUNIC_POWER_ENERGIZE, SPELLVALUE_BASE_POINT0, absorbAmount, GetTarget(), true, NULL, aurEff); } From d2e782a13b274ba0a0001c11ee183c240a49975f Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sun, 26 Jan 2014 14:26:25 +0000 Subject: [PATCH 23/25] Core/Spells: Add SPELL_ATTR0_CU_REQ_CASTER_BEHIND_TARGET to some Backstab spells Original fix by Bruescrues Closes #10767 Signed-off-by: Duarte Duarte --- src/server/game/Spells/SpellMgr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 33eb0cdf6e4..8b31e749c62 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2849,12 +2849,18 @@ void SpellMgr::LoadSpellInfoCustomAttributes() case 2589: case 2590: case 2591: + case 7159: + case 8627: case 8721: case 11279: case 11280: case 11281: + case 15582: + case 15657: + case 22416: case 25300: case 26863: + case 37685: case 48656: case 48657: case 703: // Garrote From d39b36b50f7810fc00b3e39ab7bca411e90fb83f Mon Sep 17 00:00:00 2001 From: Duarte Duarte Date: Sun, 26 Jan 2014 14:29:51 +0000 Subject: [PATCH 24/25] Tools/VMAP: Fix a logic error in processArgv of vmapexport --- src/tools/vmap4_extractor/vmapexport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp index b28ed84e105..d75af79f379 100644 --- a/src/tools/vmap4_extractor/vmapexport.cpp +++ b/src/tools/vmap4_extractor/vmapexport.cpp @@ -396,7 +396,7 @@ bool processArgv(int argc, char ** argv, const char *versionString) { hasInputPathParam = true; strcpy(input_path, argv[i+1]); - if (input_path[strlen(input_path) - 1] != '\\' || input_path[strlen(input_path) - 1] != '/') + if (input_path[strlen(input_path) - 1] != '\\' && input_path[strlen(input_path) - 1] != '/') strcat(input_path, "/"); ++i; } From 79a2a0c434d24c7bf65a0625fad9dfe87533e2fd Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sun, 26 Jan 2014 16:41:24 +0100 Subject: [PATCH 25/25] Core/Spell: Fix logic fail in 96ae4caf6258882cf89ff6d4bb3ac5aa0a3474f7 --- src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp | 4 ++-- src/server/scripts/Spells/spell_dk.cpp | 5 ++--- src/server/scripts/Spells/spell_paladin.cpp | 1 - src/server/scripts/Spells/spell_pet.cpp | 3 +-- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp index ad2d247c1e7..336599f2cc5 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -66,7 +66,7 @@ enum Phase PHASE_TWO = 2 }; -Position const SpawnBat[6] = +Position const SpawnBat[6] = { { -12291.6220f, -1380.2640f, 144.8304f, 5.483f }, { -12289.6220f, -1380.2640f, 144.8304f, 5.483f }, @@ -175,7 +175,7 @@ class boss_jeklik : public CreatureScript me->InterruptNonMeleeSpells(false); DoCastVictim(SPELL_CHAIN_MIND_FLAY); events.ScheduleEvent(EVENT_CHAIN_MIND_FLAY, urand(15000, 30000), 0, PHASE_TWO); - break; + break; case EVENT_GREATER_HEAL: me->InterruptNonMeleeSpells(false); DoCast(me, SPELL_GREATERHEAL); diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 035a17dd4bf..e2e4d30541c 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -144,9 +144,8 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader { // damage absorbed by Anti-Magic Shell energizes the DK with additional runic power. // This, if I'm not mistaken, shows that we get back ~20% of the absorbed damage as runic power. - absorbAmount *= 0.2f; - - GetTarget()->CastCustomSpell(SPELL_DK_RUNIC_POWER_ENERGIZE, SPELLVALUE_BASE_POINT0, absorbAmount, GetTarget(), true, NULL, aurEff); + int32 bp = CalculatePct(absorbAmount, 20); + GetTarget()->CastCustomSpell(SPELL_DK_RUNIC_POWER_ENERGIZE, SPELLVALUE_BASE_POINT0, bp, GetTarget(), true, NULL, aurEff); } void Register() OVERRIDE diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 6abe2fee1d3..fa03e8fe5e6 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -361,7 +361,6 @@ class spell_pal_divine_sacrifice : public SpellScriptLoader bool Load() OVERRIDE { - if (Unit* caster = GetCaster()) { if (caster->GetTypeId() == TYPEID_PLAYER) diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 3d6853daf2c..a7742630ccd 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -1498,9 +1498,8 @@ public: // Ravenous Dead. Check just if owner has Ravenous Dead since it's effect is not an aura if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0)) - { mod += aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()/100; // Ravenous Dead edits the original scale - } + // Glyph of the Ghoul if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_DEATH_KNIGHT_GLYPH_OF_GHOUL, 0)) mod += aurEff->GetAmount()/100;