mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
36
sql/updates/world/2013_01_13_02_world_gluttonous_lurkers.sql
Normal file
36
sql/updates/world/2013_01_13_02_world_gluttonous_lurkers.sql
Normal file
@@ -0,0 +1,36 @@
|
||||
-- Quest: Gluttonous Lurkers (12527)
|
||||
-- Zul'drak Rat: Spellclick spells
|
||||
DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=28202;
|
||||
INSERT INTO `npc_spellclick_spells`(`npc_entry`,`spell_id`,`cast_flags`) VALUE
|
||||
(28202,50926,1),
|
||||
(28202,50927,2);
|
||||
|
||||
-- Zul'drak Rat: SAI
|
||||
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=28202;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=28202 AND `source_type`=0;
|
||||
INSERT INTO `smart_scripts`(`entryorguid`,`event_type`,`event_param1`,`action_type`,`target_type`,`comment`) VALUES
|
||||
(28202,8,50926,41,1,'Zuldrak Rat - On spell hit of Gluttonous Lurkers: Create ZulDrak Rat Cover - Despawn');
|
||||
|
||||
-- Zul'drak Rat spell: Script assignment
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id`=50894;
|
||||
INSERT INTO `spell_script_names`(`spell_id`,`ScriptName`) VALUE
|
||||
(50894,'spell_zuldrak_rat');
|
||||
|
||||
-- Zul'drak Rat spell: Conditions
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=50894;
|
||||
INSERT INTO `conditions`(`SourceTypeOrReferenceId`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ErrorType`,`Comment`) VALUE
|
||||
(17,50894,31,1,3,28145,12,'Zuldrak Rat - Target has to be Lurking Basilisk');
|
||||
|
||||
-- Lurking Basilisk: SAI
|
||||
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=28145;
|
||||
DELETE FROM `creature_ai_scripts` WHERE `creature_id`=28145;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=28145 AND `source_type`=0;
|
||||
INSERT INTO `smart_scripts`(`entryorguid`,`event_type`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`target_type`,`comment`) VALUE
|
||||
(28145,0,5000,5000,17000,27000,11,54470,2,'Lurking Basilisk - In Combat - Cast Venemous Bite');
|
||||
|
||||
-- Gorged Lurking Basilisk: SAI
|
||||
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=28203;
|
||||
DELETE FROM `creature_ai_scripts` WHERE `creature_id`=28203;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=28203 AND `source_type`=0;
|
||||
INSERT INTO `smart_scripts`(`entryorguid`,`event_type`,`event_param1`,`action_type`,`target_type`,`comment`) VALUES
|
||||
(28203,8,50918,41,1,'Gorged Lurking Basilisk - On Spell Hit of Create Basilisk Crystals Cover - Despawn');
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "Player.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
/*####
|
||||
## npc_drakuru_shackles
|
||||
@@ -1413,6 +1414,49 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
enum SpellZuldrakRat
|
||||
{
|
||||
SPELL_SUMMON_GORGED_LURKING_BASILISK = 50928
|
||||
};
|
||||
|
||||
class spell_zuldrak_rat : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_zuldrak_rat() : SpellScriptLoader("spell_zuldrak_rat") { }
|
||||
|
||||
class spell_zuldrak_rat_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_zuldrak_rat_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_GORGED_LURKING_BASILISK))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
if (GetHitAura() && GetHitAura()->GetStackAmount() >= GetSpellInfo()->StackAmount)
|
||||
{
|
||||
GetHitUnit()->CastSpell((Unit*) NULL, SPELL_SUMMON_GORGED_LURKING_BASILISK, true);
|
||||
if (Creature* basilisk = GetHitUnit()->ToCreature())
|
||||
basilisk->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_zuldrak_rat_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_zuldrak_rat_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_zuldrak()
|
||||
{
|
||||
new npc_drakuru_shackles;
|
||||
@@ -1428,4 +1472,5 @@ void AddSC_zuldrak()
|
||||
new npc_elemental_lord;
|
||||
new npc_fiend_elemental;
|
||||
new go_scourge_enclosure;
|
||||
new spell_zuldrak_rat();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user