Permalink
Browse files

Core/Quest: Song of Wind and Water

* cleanned a bit and edited old @treak fix, credits go to him, the quest will* work 100% blizzlike when target_unit_master #8643 gets a fix for vehicle. What concerns the quest is done. I've already fixed the core kill_credit issue, but needs to be discussed.
* leaving the vehicle_AI until they get integrated correctly to SAI, this can be easily converted after. Currently need to make some hacks to make it work close to good if using SAI. (specificly terrain acts weird at that place)

Closes: #5424
  • Loading branch information...
Trista
Trista committed Dec 17, 2012
1 parent 1bd820e commit 48141bbfa6887095f5b4a687ca3bde516c751771
@@ -0,0 +1,38 @@
-- Add DB suport for quest ID: 12726 "Song of Wind and Water"
-- Indexes:
SET @HAIPHOON_W := 28999; -- WATER
SET @HAIPHOON_A := 28985; -- AIR
SET @STORM := 28858; -- Storm Revenant
SET @AQUEOUS := 28862; -- Aqueous Spirit
-- WATER VERSION SPELLS
SET @SPELL_W_1 := 61375; -- Water Bolt
SET @SPELL_W_2 := 61376; -- Frost Nova
SET @SPELL_W_3 := 52862; -- Devour Wind
-- Both version spell
SET @SPELL_AW := 52869; -- Evocation
-- AIR VERSION SPELLS
SET @SPELL_A_1 :=61374; -- Lightning Bolt
SET @SPELL_A_2 :=52870; -- Windshear
SET @SPELL_A_3 :=52864; -- Devour Water
-- Update both quest vehicles templates
-- Water version
UPDATE `creature_template` SET `spell1`=@SPELL_W_1,`spell2`=@SPELL_W_2,`spell3`=@SPELL_W_3,`spell6`=@SPELL_AW,`unit_flags`=`unit_flags`|16777216,`VehicleId`=257,`AIName`='',`exp`=2,`minlevel`=80,`maxlevel`=80,`ScriptName`='npc_haiphoon' WHERE `entry`=@HAIPHOON_W;
-- Wind version
UPDATE `creature_template` SET `spell1`=@SPELL_A_1,`spell2`=@SPELL_A_2,`spell3`=@SPELL_A_3,`spell6`=@SPELL_AW,`unit_flags`=`unit_flags`|16777216,`VehicleId`=257,`unit_class`=2,`exp`=2,`minlevel`=80,`maxlevel`=80,`ScriptName`='npc_haiphoon' WHERE `entry`=@HAIPHOON_A;
-- Insert conditions
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry` IN (@SPELL_W_3,@SPELL_A_3);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(17,0,@SPELL_W_3,0,0,31,1,3,@STORM,0,0,0,'', 'Spell Devour Wind can only target Storm Revenant'),
(17,0,@SPELL_A_3,0,0,31,1,3,@AQUEOUS,0,0,0,'', 'Spell Devour Water can only target Aqueous Spirit');
-- Add SAI and DB support for Storm Revenant and Aqueous Spirit
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@STORM,@AQUEOUS);
UPDATE `creature_template` SET `resistance3`=545 WHERE `entry`=@STORM; -- should've resistance according to video (tried to be precise as possible)
UPDATE `creature_template` SET `resistance4`=545 WHERE `entry`=@AQUEOUS; -- should've resistance according to video -//-
DELETE FROM `creature_ai_scripts` WHERE `creature_id` IN (@STORM,@AQUEOUS);
DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@STORM,@AQUEOUS);
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
(@STORM,0,0,0,0,0,100,0,2000,4000,5000,7000,11,32018,0,0,0,0,0,2,0,0,0,0,0,0,0,'Storm Revenant - IC - Cast Call Lightning'),
(@AQUEOUS,0,0,0,0,0,100,0,6000,9000,7000,10000,11,55087,0,0,0,0,0,2,0,0,0,0,0,0,0,'Aqueous Spirit - IC - Cast Typhoon');

This comment has been minimized.

Show comment
Hide comment
@Trista

Trista Dec 17, 2012

Contributor

The file had newline, but git killed it for some reason. If anyone have information how to avoid that, please share.

@Trista

Trista Dec 17, 2012

Contributor

The file had newline, but git killed it for some reason. If anyone have information how to avoid that, please share.

This comment has been minimized.

Show comment
Hide comment
@Xanvial

Xanvial Dec 17, 2012

Contributor

i guess it's working as intended, if there's new line at the end of file, github won't show it. but if there isn't, there will be a warning "no newline"

@Xanvial

Xanvial Dec 17, 2012

Contributor

i guess it's working as intended, if there's new line at the end of file, github won't show it. but if there isn't, there will be a warning "no newline"

This comment has been minimized.

Show comment
Hide comment
@Trista

Trista Dec 17, 2012

Contributor

I see, thx.

@Trista

Trista Dec 17, 2012

Contributor

I see, thx.

@@ -18,14 +18,15 @@
/* ScriptData
SDName: Sholazar_Basin
SD%Complete: 100
SDComment: Quest support: 12570, 12573, 12621.
SDComment: Quest support: 12570, 12573, 12621, 12726
SDCategory: Sholazar_Basin
EndScriptData */
/* ContentData
npc_injured_rainspeaker_oracle
npc_vekjik
avatar_of_freya
npc_haiphoon (Quest: "Song of Wind and Water")
EndContentData */
#include "ScriptMgr.h"
@@ -984,6 +985,59 @@ class spell_q12589_shoot_rjr : public SpellScriptLoader
}
};
/*######
## Quest: Song of Wind and Water ID: 12726
######*/
/*This quest precisly needs core script since battle vehicles are not well integrated with SAI,
may be easily converted to SAI when they get.*/
enum SongOfWindAndWater
{
// Spells
SPELL_DEVOUR_WIND = 52862,
SPELL_DEVOUR_WATER = 52864,
// NPCs
NPC_HAIPHOON_WATER = 28999,
NPC_HAIPHOON_AIR = 28985
};
class npc_haiphoon : public CreatureScript
{
public:
npc_haiphoon() : CreatureScript("npc_haiphoon") { }
struct npc_haiphoonAI : public VehicleAI
{
npc_haiphoonAI(Creature* creature) : VehicleAI(creature) { }
void SpellHitTarget(Unit* target, SpellInfo const* spell)
{
if (target == me)
return;
if (spell->Id == SPELL_DEVOUR_WIND)

This comment has been minimized.

Show comment
Hide comment
@Gacko

Gacko Dec 17, 2012

Member

Hm, I dont know the quest but as you dont use the Player after check anymore you could also just write GetCharmerOrOwner.... thing without storing. And then this check plus the check on spellid could be done in the same if.

And maybe else if, so second if is not checked if the first is already true :)

@Gacko

Gacko Dec 17, 2012

Member

Hm, I dont know the quest but as you dont use the Player after check anymore you could also just write GetCharmerOrOwner.... thing without storing. And then this check plus the check on spellid could be done in the same if.

And maybe else if, so second if is not checked if the first is already true :)

This comment has been minimized.

Show comment
Hide comment
@Trista

Trista Dec 17, 2012

Contributor

True, forgot to remove the variables after optimized the code as of the rest I'll change it.

@Trista

Trista Dec 17, 2012

Contributor

True, forgot to remove the variables after optimized the code as of the rest I'll change it.

This comment has been minimized.

Show comment
Hide comment
@Gacko
@Gacko
{
if (Player* player = me->GetCharmerOrOwnerPlayerOrPlayerItself())
{
me->UpdateEntry(NPC_HAIPHOON_AIR);
}
}
if (spell->Id == SPELL_DEVOUR_WATER)
{
if (Player* player = me->GetCharmerOrOwnerPlayerOrPlayerItself())
{
me->UpdateEntry(NPC_HAIPHOON_WATER);
}
}
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_haiphoonAI(creature);
}
};
void AddSC_sholazar_basin()
{
new npc_injured_rainspeaker_oracle();
@@ -995,4 +1049,5 @@ void AddSC_sholazar_basin()
new npc_jungle_punch_target();
new spell_q12620_the_lifewarden_wrath();
new spell_q12589_shoot_rjr();
new npc_haiphoon();
}

0 comments on commit 48141bb

Please sign in to comment.