mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-17 08:00:48 +01:00
DB/Script: The Only Cure is More Green Glow
Closes #1723 SQL by Staleness89, corrections by Killyana Script by Keader, corrections by sirikfoll and me
This commit is contained in:
19
sql/updates/world/3.3.5/2017_01_07_03_world_335.sql
Normal file
19
sql/updates/world/3.3.5/2017_01_07_03_world_335.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
DELETE FROM `conditions` WHERE `SourceEntry`= 11513 AND (`SourceTypeOrReferenceId`=17 OR `SourceTypeOrReferenceId`=13);
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(17, 0, 11513, 0, 0, 29, 0, 6213, 5, 0, 0, 0, 0, '', 'Must be near NPC to cast'),
|
||||
(17, 0, 11513, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, '', 'Must be near NPC to cast'),
|
||||
(17, 0, 11513, 0, 1, 29, 0, 6329, 5, 0, 0, 0, 0, '', 'Must be near NPC to cast'),
|
||||
(17, 0, 11513, 0, 1, 36, 0, 0, 0, 0, 0, 0, 0, '', 'Must be near NPC to cast');
|
||||
|
||||
DELETE FROM `conditions` WHERE `SourceEntry`= 12709 AND (`SourceTypeOrReferenceId`=17 OR `SourceTypeOrReferenceId`=13);
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(17, 0, 12709, 0, 0, 29, 0, 6218, 5, 0, 0, 0, 0, '', 'Must be near NPC to cast'),
|
||||
(17, 0, 12709, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, '', 'Must be near NPC to cast'),
|
||||
(17, 0, 12709, 0, 1, 29, 0, 6220, 5, 0, 0, 0, 0, '', 'Must be near NPC to cast'),
|
||||
(17, 0, 12709, 0, 1, 36, 0, 0, 0, 0, 0, 0, 0, '', 'Must be near NPC to cast'),
|
||||
(17, 0, 12709, 0, 2, 29, 0, 6219, 5, 0, 0, 0, 0, '', 'Must be near NPC to cast'),
|
||||
(17, 0, 12709, 0, 2, 36, 0, 0, 0, 0, 0, 0, 0, '', 'Must be near NPC to cast');
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_collecting_fallout';
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(12709, 'spell_collecting_fallout');
|
||||
@@ -545,8 +545,56 @@ public:
|
||||
|
||||
};
|
||||
|
||||
// 12709 - Collecting Fallout
|
||||
class spell_collecting_fallout : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_collecting_fallout() : SpellScriptLoader("spell_collecting_fallout") { }
|
||||
|
||||
class spell_collecting_fallout_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_collecting_fallout_SpellScript);
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
_spellFail = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnLaunch(SpellEffIndex effIndex)
|
||||
{
|
||||
// estimated 25% chance of success
|
||||
if (roll_chance_i(25))
|
||||
_spellFail = false;
|
||||
else
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
}
|
||||
|
||||
void HandleFail(SpellEffIndex effIndex)
|
||||
{
|
||||
if (!_spellFail)
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectLaunch += SpellEffectFn(spell_collecting_fallout_SpellScript::OnLaunch, EFFECT_0, SPELL_EFFECT_TRIGGER_SPELL);
|
||||
OnEffectLaunch += SpellEffectFn(spell_collecting_fallout_SpellScript::HandleFail, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL);
|
||||
}
|
||||
|
||||
bool _spellFail;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_collecting_fallout_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_gnomeregan()
|
||||
{
|
||||
new npc_blastmaster_emi_shortfuse();
|
||||
new boss_grubbis();
|
||||
|
||||
new spell_collecting_fallout();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user