From 5aef24e6f57323dc03a97bf7ec590f26ba0f038d Mon Sep 17 00:00:00 2001 From: Xfurry Date: Mon, 13 Aug 2012 20:24:01 +0200 Subject: [PATCH] [12090] Implement some spells for AQ40 Dark Glare beam spells: 26137, 26009, 26136 and 26029 Server side spell: 26133 --- sql/mangos.sql | 1 + .../99999_01_mangos_spell_template.sql | 3 ++ src/game/Spell.cpp | 9 ++++-- src/game/SpellAuras.cpp | 32 +++++++++++++++---- src/game/SpellEffects.cpp | 8 +++++ src/shared/revision_nr.h | 2 +- 6 files changed, 45 insertions(+), 10 deletions(-) create mode 100644 sql/updates/99999_01_mangos_spell_template.sql diff --git a/sql/mangos.sql b/sql/mangos.sql index 97c7cd39a..561348086 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -18018,6 +18018,7 @@ INSERT INTO `spell_template` VALUES (21387, 0x00000028, 15, 21, 6, 1, 0, 42, 0, 21388, 'Melt-Weapon trigger aura related used by Ragnaros'), (23363, 0x00000000, 101, 21, 76, 18, 0, 0, 179804, 0, 'Summon Drakonid Corpse Trigger'), (25192, 0x00000000, 101, 21, 76, 18, 0, 0, 180619, 0, 'Summon Ossirian Crystal'), +(26133, 0x00000000, 101, 21, 76, 18, 0, 0, 180795, 0, 'Summon Sandworm Base'), (62388, 0x00000000, 101, 21, 6, 1, 0, 4, 0, 0, 'Aura required for Demonic Circle 48020'); /*!40000 ALTER TABLE `spell_template` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/updates/99999_01_mangos_spell_template.sql b/sql/updates/99999_01_mangos_spell_template.sql new file mode 100644 index 000000000..f128686c9 --- /dev/null +++ b/sql/updates/99999_01_mangos_spell_template.sql @@ -0,0 +1,3 @@ +DELETE FROM spell_template WHERE id IN (26133); +INSERT INTO spell_template VALUES +(26133, 0x00000000, 101, 21, 76, 18, 0, 0, 180795, 0, 'Summon Sandworm Base'); diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 3b41c73c6..7a3d7f7c8 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2482,8 +2482,13 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& break; case TARGET_IN_FRONT_OF_CASTER: { - bool inFront = m_spellInfo->SpellVisual[0] != 3879; - FillAreaTargets(targetUnitMap, radius, inFront ? PUSH_IN_FRONT : PUSH_IN_BACK, SPELL_TARGETS_AOE_DAMAGE); + SpellNotifyPushType pushType = PUSH_IN_FRONT; + switch (m_spellInfo->SpellVisual[0]) // Some spell require a different target fill + { + case 3879: pushType = PUSH_IN_BACK; break; + case 7441: pushType = PUSH_IN_FRONT_15; break; + } + FillAreaTargets(targetUnitMap, radius, pushType, SPELL_TARGETS_AOE_DAMAGE); break; } case TARGET_LARGE_FRONTAL_CONE: diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 9d9fa7370..be23b050f 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -46,6 +46,7 @@ #include "Vehicle.h" #include "CellImpl.h" #include "Language.h" +#include "MapManager.h" #define NULL_AURA_SLOT 0xFF @@ -1264,10 +1265,23 @@ void Aura::TriggerSpell() } // // Pain Spike // case 25572: break; -// // Rotate 360 -// case 26009: break; -// // Rotate -360 -// case 26136: break; + case 26009: // Rotate 360 + case 26136: // Rotate -360 + { + float newAngle = target->GetOrientation(); + + if (auraId == 26009) + newAngle += M_PI_F/40; + else + newAngle -= M_PI_F/40; + + MapManager::NormalizeOrientation(newAngle); + + target->SetFacingTo(newAngle); + + target->CastSpell(target, 26029, true); + return; + } // // Consume // case 26196: break; // // Berserk @@ -8094,9 +8108,13 @@ void Aura::PeriodicDummyTick() case 68876: // Wailing Souls { // Sweep around - float newAngle = target->GetOrientation() + (spell->Id == 68875 ? 0.09f : 2 * M_PI_F - 0.09f); - if (newAngle > 2 * M_PI_F) - newAngle -= 2 * M_PI_F; + float newAngle = target->GetOrientation(); + if (spell->Id == 68875) + newAngle += 0.09f; + else + newAngle -= 0.09f; + + MapManager::NormalizeOrientation(newAngle); target->SetFacingTo(newAngle); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index a6e68c58e..89770b3b4 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -6871,6 +6871,14 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect) unitTarget->HandleEmote(EMOTE_ONESHOT_CHEER); return; } + case 26137: // Rotate Trigger + { + if (!unitTarget) + return; + + unitTarget->CastSpell(unitTarget, urand(0, 1) ? 26009 : 26136, true); + return; + } case 26218: // Mistletoe { if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 9007d8883..5103857b4 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "0078" + #define REVISION_NR "12090" #endif // __REVISION_NR_H__