Scripts/Quest: Make 'Search and Rescue' less hacky (#27227)

(cherry picked from commit 6e07acbbde)
This commit is contained in:
offl
2021-11-01 18:11:39 +02:00
committed by Shauren
parent 77bb4d2619
commit 6d36a4f77a
3 changed files with 69 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
--
DELETE FROM `smart_scripts` WHERE `entryorguid` = 27909 AND `source_type` = 0;
DELETE FROM `smart_scripts` WHERE `entryorguid` BETWEEN 2790900 AND 2790902 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`,`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
(27909,0,0,0,37,0,100,0,0,0,0,0,0,116,10,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Darkweb Victim - On AI Initialize - Set Corpse Delay"),
(27909,0,1,0,37,0,100,0,0,0,0,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Darkweb Victim - On AI Initialize - Set Reactstate Passive"),
(27909,0,2,0,11,0,100,0,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Darkweb Victim - On Spawn - Set Event Phase 1"),
(27909,0,3,0,38,0,100,0,1,1,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Darkweb Victim - On Data Set 1 1 - Set Event Phase 2"),
(27909,0,4,0,6,1,100,0,0,0,0,0,0,11,49960,2,0,0,0,0,1,0,0,0,0,0,0,0,0,"Darkweb Victim - On Death - Cast 'Summon Random Drakkari' (Phase 1)"),
(27909,0,5,0,6,2,100,0,0,0,0,0,0,11,49952,2,0,0,0,0,1,0,0,0,0,0,0,0,0,"Darkweb Victim - On Death - Cast 'Summon Kurzel' (Phase 2)");
DELETE FROM `spell_script_names` WHERE `spell_id` = 49960 AND `ScriptName` = 'spell_summon_random_drakkari';
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(49960,'spell_summon_random_drakkari');

View File

@@ -0,0 +1,53 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureAIImpl.h"
#include "ScriptMgr.h"
#include "SpellScript.h"
#include "Unit.h"
enum SummonRandomDrakkari
{
SPELL_SUMMON_DRAKKARI_SHAMAN = 49958,
SPELL_SUMMON_DRAKKARI_GUARDIAN = 49959
};
// 49960 - Summon Random Drakkari
class spell_summon_random_drakkari : public SpellScript
{
PrepareSpellScript(spell_summon_random_drakkari);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_SUMMON_DRAKKARI_SHAMAN, SPELL_SUMMON_DRAKKARI_GUARDIAN });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
GetCaster()->CastSpell(GetCaster(), RAND(SPELL_SUMMON_DRAKKARI_SHAMAN, SPELL_SUMMON_DRAKKARI_GUARDIAN), true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_summon_random_drakkari::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
void AddSC_drak_tharon_keep()
{
RegisterSpellScript(spell_summon_random_drakkari);
}

View File

@@ -41,6 +41,7 @@ void AddSC_boss_novos();
void AddSC_boss_king_dred();
void AddSC_boss_tharon_ja();
void AddSC_instance_drak_tharon_keep();
void AddSC_drak_tharon_keep();
// Trial of the Champion
void AddSC_boss_argent_challenge();
void AddSC_boss_black_knight();
@@ -237,6 +238,7 @@ void AddNorthrendScripts()
AddSC_boss_king_dred();
AddSC_boss_tharon_ja();
AddSC_instance_drak_tharon_keep();
AddSC_drak_tharon_keep();
// Trial of the Champion
AddSC_boss_argent_challenge();
AddSC_boss_black_knight();