Skip to content

Commit cac0188

Browse files
authored
Scripts/Spells: Implement Itch (TrinityCore#31193)
1 parent f22afbc commit cac0188

File tree

4 files changed

+102
-1
lines changed

4 files changed

+102
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--
2+
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_ruins_of_ahnqiraj_itch', 'spell_temple_of_ahnqiraj_itch');
3+
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
4+
(25185, 'spell_ruins_of_ahnqiraj_itch'),
5+
(26077, 'spell_temple_of_ahnqiraj_itch');
6+
7+
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 15325;
8+
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (15325,15236) AND `source_type` = 0;
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`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
10+
(15325,0,0,0,0,0,100,0,5000,10000,10000,15000,0,11,25185,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Hive'Zara Wasp - In Combat - Cast 'Itch'"),
11+
(15236,0,0,0,0,0,100,0,5000,10000,10000,15000,0,11,26077,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Vekniss Wasp - In Combat - Cast 'Itch'");
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3+
*
4+
* This program is free software; you can redistribute it and/or modify it
5+
* under the terms of the GNU General Public License as published by the
6+
* Free Software Foundation; either version 2 of the License, or (at your
7+
* option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12+
* more details.
13+
*
14+
* You should have received a copy of the GNU General Public License along
15+
* with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#include "ScriptMgr.h"
19+
#include "SpellAuras.h"
20+
#include "SpellScript.h"
21+
#include "Unit.h"
22+
23+
enum AQ20Itch
24+
{
25+
SPELL_HIVEZARA_CATALYST = 25187
26+
};
27+
28+
// 25185 - Itch
29+
class spell_ruins_of_ahnqiraj_itch : public AuraScript
30+
{
31+
PrepareAuraScript(spell_ruins_of_ahnqiraj_itch);
32+
33+
bool Validate(SpellInfo const* /*spellInfo*/) override
34+
{
35+
return ValidateSpellInfo({ SPELL_HIVEZARA_CATALYST });
36+
}
37+
38+
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
39+
{
40+
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
41+
return;
42+
43+
if (Unit* caster = GetCaster())
44+
caster->CastSpell(GetTarget(), SPELL_HIVEZARA_CATALYST, true);
45+
}
46+
47+
void Register() override
48+
{
49+
AfterEffectRemove += AuraEffectRemoveFn(spell_ruins_of_ahnqiraj_itch::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
50+
}
51+
};
52+
53+
void AddSC_ruins_of_ahnqiraj()
54+
{
55+
RegisterSpellScript(spell_ruins_of_ahnqiraj_itch);
56+
}

src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.cpp

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
*/
1717

1818
#include "ScriptMgr.h"
19+
#include "SpellAuras.h"
1920
#include "SpellScript.h"
2021
#include "Unit.h"
2122

22-
enum Spells
23+
enum AQ40TeleportSpells
2324
{
2425
SPELL_TELEPORT_TO_TWIN_EMPS_EFFECT = 29181,
2526
SPELL_TELEPORT_TO_FINAL_CHAMBER_EFFECT = 29190
@@ -67,8 +68,39 @@ class spell_temple_of_ahnqiraj_teleport_to_final_chamber : public SpellScript
6768
}
6869
};
6970

71+
enum AQ40Itch
72+
{
73+
SPELL_VEKNISS_CATALYST = 26078
74+
};
75+
76+
// 26077 - Itch
77+
class spell_temple_of_ahnqiraj_itch : public AuraScript
78+
{
79+
PrepareAuraScript(spell_temple_of_ahnqiraj_itch);
80+
81+
bool Validate(SpellInfo const* /*spellInfo*/) override
82+
{
83+
return ValidateSpellInfo({ SPELL_VEKNISS_CATALYST });
84+
}
85+
86+
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
87+
{
88+
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
89+
return;
90+
91+
if (Unit* caster = GetCaster())
92+
caster->CastSpell(GetTarget(), SPELL_VEKNISS_CATALYST, true);
93+
}
94+
95+
void Register() override
96+
{
97+
AfterEffectRemove += AuraEffectRemoveFn(spell_temple_of_ahnqiraj_itch::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
98+
}
99+
};
100+
70101
void AddSC_temple_of_ahnqiraj()
71102
{
72103
RegisterSpellScript(spell_temple_of_ahnqiraj_teleport_to_twin_emperors);
73104
RegisterSpellScript(spell_temple_of_ahnqiraj_teleport_to_final_chamber);
105+
RegisterSpellScript(spell_temple_of_ahnqiraj_itch);
74106
}

src/server/scripts/Kalimdor/kalimdor_script_loader.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ void AddSC_boss_buru();
8383
void AddSC_boss_ayamiss();
8484
void AddSC_boss_ossirian();
8585
void AddSC_instance_ruins_of_ahnqiraj();
86+
void AddSC_ruins_of_ahnqiraj();
8687
// Temple of ahn'qiraj
8788
void AddSC_boss_cthun();
8889
void AddSC_boss_viscidus();
@@ -197,6 +198,7 @@ void AddKalimdorScripts()
197198
AddSC_boss_ayamiss();
198199
AddSC_boss_ossirian();
199200
AddSC_instance_ruins_of_ahnqiraj();
201+
AddSC_ruins_of_ahnqiraj();
200202
// Temple of ahn'qiraj
201203
AddSC_boss_cthun();
202204
AddSC_boss_viscidus();

0 commit comments

Comments
 (0)