diff options
author | Kittnz <frederik156@hotmail.com> | 2016-11-29 21:44:23 +0100 |
---|---|---|
committer | Kittnz <frederik156@hotmail.com> | 2016-11-29 21:44:23 +0100 |
commit | 1553cc02fb2bce477b4ce9b2e93a68b97aa20b29 (patch) | |
tree | b6c6fa1525db77de35f11a8701603d5365040210 | |
parent | 0f649d51e94794bbd3b54d9e83a2cc1fa09f4bbe (diff) |
Core/Scripts: Drake Hunt
- Removed creature script
- Using a spell script for red dragonblood spell http://wotlk.openwow.com/spell=46620 from sunwell
- Updated the SAI scripts for the quest Drake Hunt also from sunwell and fixed by Kilyana
-rw-r--r-- | sql/updates/world/3.3.5/2016_11_29_00_world.sql | 48 | ||||
-rw-r--r-- | src/server/scripts/Northrend/zone_borean_tundra.cpp | 124 |
2 files changed, 73 insertions, 99 deletions
diff --git a/sql/updates/world/3.3.5/2016_11_29_00_world.sql b/sql/updates/world/3.3.5/2016_11_29_00_world.sql new file mode 100644 index 00000000000..8487cca92f6 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_11_29_00_world.sql @@ -0,0 +1,48 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=46620 AND `ScriptName`='spell_red_dragonblood'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(46620, 'spell_red_dragonblood'); + +DELETE FROM `creature_text` WHERE `entry`=26117; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(26117, 0, 0, 'Easy now, drakeling.', 12, 0, 100, 0, 0, 0, 25325, 0, 'Raelorasz - say_drake_0'), +(26117, 1, 0, 'A wonderful specimen.', 12, 0, 100, 0, 0, 0, 25324, 0, 'Raelorasz - say_drake_1'), +(26117, 1, 1, 'Sleep now, young one....', 12, 0, 100, 0, 0, 0, 25323, 0, 'Raelorasz - say_drake_2'), +(26117, 1, 2, 'Yes, this one should advance my studies nicely....', 12, 0, 100, 0, 0, 0, 25326, 0, 'say_drake_3'); + +DELETE FROM conditions WHERE SourceTypeOrReferenceId=13 AND SourceEntry=46704; +INSERT INTO conditions VALUES (13, 1, 46704, 0, 0, 31, 0, 3, 26127, 0, 0, 0, 0, '', 'Target Nexus Drake Hatchling'); + +-- Raelorasz SAI +SET @ENTRY := 26117; +UPDATE `creature_template` SET `AIName`="SmartAI", `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +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`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,62,0,100,0,9253,1,0,0,85,46764,1,0,0,0,0,7,0,0,0,0,0,0,0,"Raelorasz - On Gossip Option 1 Selected - Invoker Cast 'Push Arcane Prison'"), +(@ENTRY,0,1,0,61,0,100,0,9253,1,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Raelorasz - On Gossip Option 1 Selected - Close Gossip"), +(@ENTRY,0,2,0,60,0,100,0,5000,5000,5000,5000,45,1,26127,0,0,0,0,11,26127,30,0,0,0,0,0,"Raelorasz - On Update - Set Data 1 26127"); + +-- Nexus Drake Hatchling SAI +SET @ENTRY := 26127; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100+00 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`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,0,12000,15000,25000,35000,11,36631,0,0,0,0,0,1,0,0,0,0,0,0,0,"Nexus Drake Hatchling - In Combat - Cast 'Netherbreath'"), +(@ENTRY,0,1,0,0,0,100,0,5000,10000,20000,35000,11,36513,0,0,0,0,0,1,0,0,0,0,0,0,0,"Nexus Drake Hatchling - In Combat - Cast 'Intangible Presence'"), +(@ENTRY,0,2,3,8,0,100,0,46607,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0,"Nexus Drake Hatchling - On Spellhit 'Drake Harpoon' - Store Targetlist"), +(@ENTRY,0,3,4,61,0,100,0,0,0,0,0,117,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Nexus Drake Hatchling - On Spellhit 'Drake Harpoon' - evade off"), +(@ENTRY,0,4,5,61,0,100,0,0,0,0,0,86,46620,2,12,1,0,0,1,0,0,0,0,0,0,0,"Nexus Drake Hatchling - On Spellhit 'Drake Harpoon' - Cross Cast 'Red Dragonblood'"), +(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Nexus Drake Hatchling - On Spellhit 'Drake Harpoon' - Start Attacking"), +(@ENTRY,0,6,0,25,0,100,0,0,0,0,0,19,768,0,0,0,0,0,1,0,0,0,0,0,0,0,"Nexus Drake Hatchling - On Reset - Remove Flags Immune To Players & Immune To NPC's"), +(@ENTRY,0,7,0,25,0,100,0,0,0,0,0,91,7,0,0,0,0,0,1,0,0,0,0,0,0,0,"Nexus Drake Hatchling - On Reset - Remove Flag"), +(@ENTRY,0,8,0,38,0,100,1,1,26127,0,0,80,@ENTRY*100+00,2,0,0,0,0,1,0,0,0,0,0,0,0,"Nexus Drake Hatchling - On Data Set 1 26127 - Run Script (No Repeat)"), +(@ENTRY,0,9,10,8,0,100,1,46704,0,0,0,11,46703,0,0,0,0,0,1,0,0,0,0,0,0,0,"Nexus Drake Hatchling - On Spellhit 'Raelorasz Fireball' - Cast 'Complete Immolation' (No Repeat)"), +(@ENTRY,0,10,11,61,0,100,0,0,0,0,0,90,7,0,0,0,0,0,1,0,0,0,0,0,0,0,"Nexus Drake Hatchling - On Spellhit 'Raelorasz Fireball' - Set Flag Standstate Dead (No Repeat)"), +(@ENTRY,0,11,0,61,0,100,0,0,0,0,0,41,4000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Nexus Drake Hatchling - On Spellhit 'Raelorasz Fireball' - Despawn In 4000 ms (No Repeat)"), +(@ENTRY,0,12,0,1,0,100,1,0,0,0,0,117,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Nexus Drake Hatchling - Ooc - evade on"), +(@ENTRY*100+00,9,0,0,0,0,100,0,0,0,0,0,33,26175,0,0,0,0,0,12,1,0,0,0,0,0,0,"Nexus Drake Hatchling - On Script - Quest Credit ''"), +(@ENTRY*100+00,9,1,0,0,0,100,0,0,0,0,0,28,46607,0,0,0,0,0,1,0,0,0,0,0,0,0,"Nexus Drake Hatchling - On Script - Remove Aura 'Drake Harpoon'"), +(@ENTRY*100+00,9,2,0,0,0,100,0,0,0,0,0,29,0,0,0,0,0,0,19,26175,40,0,0,0,0,0,"Nexus Drake Hatchling - On Script - follow"), +(@ENTRY*100+00,9,3,0,0,0,100,0,3000,3000,0,0,1,0,0,0,0,0,0,19,26117,30,0,0,0,0,0,"Nexus Drake Hatchling - On Script - Say Line 0"), +(@ENTRY*100+00,9,4,0,0,0,100,0,0,0,0,0,86,46704,0,19,26117,30,0,1,0,0,0,0,0,0,0,"Nexus Drake Hatchling - On Script - Cross Cast 'Raelorasz Fireball'"), +(@ENTRY*100+00,9,5,0,0,0,100,0,4000,4000,0,0,1,1,0,0,0,0,0,19,26117,30,0,0,0,0,0,"Nexus Drake Hatchling - On Script - Say Line 1"); diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index ed7872dea4a..2a29c2af594 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -31,7 +31,6 @@ npc_khunok_the_behemoth npc_nerubar_victim npc_nesingwary_trapper npc_lurgglbr -npc_nexus_drake_hatchling EndContentData */ #include "ScriptMgr.h" @@ -681,121 +680,48 @@ public: } }; -/*###### -## npc_nexus_drake_hatchling -######*/ - -enum NexusDrakeHatchling +enum red_dragonblood { - SPELL_DRAKE_HARPOON = 46607, - SPELL_RED_DRAGONBLOOD = 46620, - SPELL_DRAKE_HATCHLING_SUBDUED = 46691, - SPELL_SUBDUED = 46675, - - NPC_RAELORASZ = 26117, - - QUEST_DRAKE_HUNT = 11919, - QUEST_DRAKE_HUNT_D = 11940 + SPELL_DRAKE_HATCHLING_SUBDUED = 46691, + SPELL_SUBDUED = 46675 }; -class npc_nexus_drake_hatchling : public CreatureScript +class spell_red_dragonblood : public SpellScriptLoader { public: - npc_nexus_drake_hatchling() : CreatureScript("npc_nexus_drake_hatchling") { } + spell_red_dragonblood() : SpellScriptLoader("spell_red_dragonblood") { } - struct npc_nexus_drake_hatchlingAI : public FollowerAI //The spell who makes the npc follow the player is missing, also we can use FollowerAI! + class spell_red_dragonblood_AuraScript : public AuraScript { - npc_nexus_drake_hatchlingAI(Creature* creature) : FollowerAI(creature) - { - Initialize(); - } + PrepareAuraScript(spell_red_dragonblood_AuraScript); - void Initialize() + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - WithRedDragonBlood = false; - } - - ObjectGuid HarpoonerGUID; - bool WithRedDragonBlood; - - void Reset() override - { - Initialize(); - } - - void EnterCombat(Unit* who) override - { - if (me->IsValidAttackTarget(who)) - AttackStart(who); - } - - void SpellHit(Unit* caster, const SpellInfo* spell) override - { - if (spell->Id == SPELL_DRAKE_HARPOON && caster->GetTypeId() == TYPEID_PLAYER) - { - HarpoonerGUID = caster->GetGUID(); - DoCast(me, SPELL_RED_DRAGONBLOOD, true); - } - WithRedDragonBlood = true; - } - - void MoveInLineOfSight(Unit* who) override - - { - FollowerAI::MoveInLineOfSight(who); - - if (!HarpoonerGUID) + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE || !GetCaster()) return; - if (me->HasAura(SPELL_SUBDUED) && who->GetEntry() == NPC_RAELORASZ) - { - if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE)) - { - if (Player* pHarpooner = ObjectAccessor::GetPlayer(*me, HarpoonerGUID)) - { - pHarpooner->KilledMonsterCredit(26175); - pHarpooner->RemoveAura(SPELL_DRAKE_HATCHLING_SUBDUED); - SetFollowComplete(); - HarpoonerGUID.Clear(); - me->DisappearAndDie(); - } - } - } + Creature* owner = GetOwner()->ToCreature(); + owner->RemoveAllAurasExceptType(SPELL_AURA_DUMMY); + owner->CombatStop(true); + owner->DeleteThreatList(); + owner->GetMotionMaster()->Clear(false); + owner->GetMotionMaster()->MoveFollow(GetCaster(), 4.0f, 0.0f); + owner->CastSpell(owner, SPELL_SUBDUED, true); + GetCaster()->CastSpell(GetCaster(), SPELL_DRAKE_HATCHLING_SUBDUED, true); + owner->setFaction(35); + owner->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + owner->DespawnOrUnsummon(3 * MINUTE*IN_MILLISECONDS); } - void UpdateAI(uint32 /*diff*/) override + void Register() { - if (WithRedDragonBlood && HarpoonerGUID && !me->HasAura(SPELL_RED_DRAGONBLOOD)) - { - if (Player* pHarpooner = ObjectAccessor::GetPlayer(*me, HarpoonerGUID)) - { - EnterEvadeMode(); - StartFollow(pHarpooner, 35, NULL); - - DoCast(me, SPELL_SUBDUED, true); - pHarpooner->CastSpell(pHarpooner, SPELL_DRAKE_HATCHLING_SUBDUED, true); - - me->AttackStop(); - WithRedDragonBlood = false; - } - } - - if ((me->getFaction() == 35) && (!me->HasAura(SPELL_SUBDUED))) - { - HarpoonerGUID.Clear(); - me->DisappearAndDie(); - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); + AfterEffectRemove += AuraEffectRemoveFn(spell_red_dragonblood_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); } }; - CreatureAI* GetAI(Creature* creature) const override + AuraScript* GetAuraScript() const { - return new npc_nexus_drake_hatchlingAI(creature); + return new spell_red_dragonblood_AuraScript(); } }; @@ -2456,7 +2382,7 @@ void AddSC_borean_tundra() new npc_nerubar_victim(); new npc_nesingwary_trapper(); new npc_lurgglbr(); - new npc_nexus_drake_hatchling(); + new spell_red_dragonblood(); new npc_thassarian(); new npc_image_lich_king(); new npc_counselor_talbot(); |