From 6cdacbd313fa6f426ada895feead584797ff8caf Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 16 Feb 2010 15:36:19 -0700 Subject: * Removed hack for summon water elemental * Proper handling for Glyph of Eternal Water * Summoned water elemental still doesn't last forever, but the right spells * are cast in the right situations. * Credits to Edrinn --HG-- branch : trunk --- sql/updates/7370_world_spell_linked_spell.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/7370_world_spell_linked_spell.sql (limited to 'sql') diff --git a/sql/updates/7370_world_spell_linked_spell.sql b/sql/updates/7370_world_spell_linked_spell.sql new file mode 100644 index 00000000000..2c6910501ab --- /dev/null +++ b/sql/updates/7370_world_spell_linked_spell.sql @@ -0,0 +1,2 @@ +-- Remove hack for glyph of Eternal Water +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=31687 AND `spell_effect`=70907; -- cgit v1.2.3 From 08c6dae672257b5ccc9cca48b04dbec2e344fbf8 Mon Sep 17 00:00:00 2001 From: Tartalo Date: Wed, 17 Feb 2010 15:53:16 +0100 Subject: Borean Tundra: Support for quest 11876 'Help Those That Cannot Help Themselves' --HG-- branch : trunk --- sql/updates/7373_world_creature_template.sql | 2 + sql/updates/7373_world_item_template.sql | 2 + src/scripts/northrend/borean_tundra.cpp | 134 +++++++++++++++++++++++++++ src/scripts/world/item_scripts.cpp | 75 +++++++++++++++ 4 files changed, 213 insertions(+) create mode 100644 sql/updates/7373_world_creature_template.sql create mode 100644 sql/updates/7373_world_item_template.sql (limited to 'sql') diff --git a/sql/updates/7373_world_creature_template.sql b/sql/updates/7373_world_creature_template.sql new file mode 100644 index 00000000000..e7bd039ddd5 --- /dev/null +++ b/sql/updates/7373_world_creature_template.sql @@ -0,0 +1,2 @@ +UPDATE `creatyre_template` SET `scriptname`='npc_trapped_mammoth_calf' WHERE `entry`=25850; + diff --git a/sql/updates/7373_world_item_template.sql b/sql/updates/7373_world_item_template.sql new file mode 100644 index 00000000000..e9c51195524 --- /dev/null +++ b/sql/updates/7373_world_item_template.sql @@ -0,0 +1,2 @@ +UPDATE `item_template` SET `scriptname`='item_dehta_trap_smasher' WHERE `entry`=35228; + diff --git a/src/scripts/northrend/borean_tundra.cpp b/src/scripts/northrend/borean_tundra.cpp index 0fb147d9d0b..6396b58c1ac 100644 --- a/src/scripts/northrend/borean_tundra.cpp +++ b/src/scripts/northrend/borean_tundra.cpp @@ -1987,6 +1987,135 @@ CreatureAI* GetAI_npc_bonker_togglevolt(Creature* pCreature) return new npc_bonker_togglevoltAI(pCreature); } +/*###### +## Help Those That Cannot Help Themselves, Quest 11876 +######*/ + +enum eHelpThemselves +{ + QUEST_CANNOT_HELP_THEMSELVES = 11876, + GO_MAMMOTH_TRAP_1 = 188022, + GO_MAMMOTH_TRAP_2 = 188024, + GO_MAMMOTH_TRAP_3 = 188025, + GO_MAMMOTH_TRAP_4 = 188026, + GO_MAMMOTH_TRAP_5 = 188027, + GO_MAMMOTH_TRAP_6 = 188028, + GO_MAMMOTH_TRAP_7 = 188029, + GO_MAMMOTH_TRAP_8 = 188030, + GO_MAMMOTH_TRAP_9 = 188031, + GO_MAMMOTH_TRAP_10 = 188032, + GO_MAMMOTH_TRAP_11 = 188033, + GO_MAMMOTH_TRAP_12 = 188034, + GO_MAMMOTH_TRAP_13 = 188035, + GO_MAMMOTH_TRAP_14 = 188036, + GO_MAMMOTH_TRAP_15 = 188037, + GO_MAMMOTH_TRAP_16 = 188038, + GO_MAMMOTH_TRAP_17 = 188039, + GO_MAMMOTH_TRAP_18 = 188040, + GO_MAMMOTH_TRAP_19 = 188041, + GO_MAMMOTH_TRAP_20 = 188042, + GO_MAMMOTH_TRAP_21 = 188043, + GO_MAMMOTH_TRAP_22 = 188044, +}; + +struct npc_trapped_mammoth_calfAI : public ScriptedAI +{ + npc_trapped_mammoth_calfAI(Creature* c) : ScriptedAI(c) {} + + uint32 uiTimer; + bool bStarted; + + void Reset() + { + GameObject *pTrap; + + uiTimer = 1500; + bStarted = false; + + if ((pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_1,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_2,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_3,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_4,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_5,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_6,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_7,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_8,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_9,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_10,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_11,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_12,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_13,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_14,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_15,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_16,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_17,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_18,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_19,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_20,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_21,1.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_22,1.0f))) + pTrap->SetGoState(GO_STATE_ACTIVE); + } + + void UpdateAI(const uint32 diff) + { + if (bStarted) + { + if (uiTimer <= diff) + { + Position pos; + m_creature->GetRandomNearPosition(pos, 10.0f); + m_creature->GetMotionMaster()->MovePoint(0,pos); + bStarted = false; + } + else uiTimer -= diff; + } + } + + void DoAction(const int32 param) + { + if (param == 1) + bStarted = true; + } + + void MovementInform(uint32 uiType, uint32 uiId) + { + GameObject* pTrap; + if (uiType != POINT_MOTION_TYPE) + return; + m_creature->DisappearAndDie(); + + if ((pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_1,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_2,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_3,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_4,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_5,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_6,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_7,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_8,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_9,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_10,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_11,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_12,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_13,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_14,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_15,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_16,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_17,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_18,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_19,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_20,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_21,11.0f)) || + (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_22,11.0f))) + pTrap->SetLootState(GO_JUST_DEACTIVATED); + } +}; + +CreatureAI* GetAI_npc_trapped_mammoth_calf(Creature* pCreature) +{ + return new npc_trapped_mammoth_calfAI(pCreature); +} + void AddSC_borean_tundra() { Script *newscript; @@ -2122,4 +2251,9 @@ void AddSC_borean_tundra() newscript->GetAI = &GetAI_npc_bonker_togglevolt; newscript->pQuestAccept=&QuestAccept_npc_bonker_togglevolt; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_trapped_mammoth_calf"; + newscript->GetAI = &GetAI_npc_trapped_mammoth_calf; + newscript->RegisterSelf(); } diff --git a/src/scripts/world/item_scripts.cpp b/src/scripts/world/item_scripts.cpp index 658ee379fdf..6787e8df303 100644 --- a/src/scripts/world/item_scripts.cpp +++ b/src/scripts/world/item_scripts.cpp @@ -316,6 +316,76 @@ bool ItemUse_item_petrov_cluster_bombs(Player* pPlayer, Item* pItem, const Spell return false; } +/*###### +# item_dehta_trap_smasher +# For quest 11876, Help Those That Cannot Help Themselves +######*/ +enum eHelpThemselves +{ + QUEST_CANNOT_HELP_THEMSELVES = 11876, + NPC_TRAPPED_MAMMOTH_CALF = 25850, + GO_MAMMOTH_TRAP_1 = 188022, + GO_MAMMOTH_TRAP_2 = 188024, + GO_MAMMOTH_TRAP_3 = 188025, + GO_MAMMOTH_TRAP_4 = 188026, + GO_MAMMOTH_TRAP_5 = 188027, + GO_MAMMOTH_TRAP_6 = 188028, + GO_MAMMOTH_TRAP_7 = 188029, + GO_MAMMOTH_TRAP_8 = 188030, + GO_MAMMOTH_TRAP_9 = 188031, + GO_MAMMOTH_TRAP_10 = 188032, + GO_MAMMOTH_TRAP_11 = 188033, + GO_MAMMOTH_TRAP_12 = 188034, + GO_MAMMOTH_TRAP_13 = 188035, + GO_MAMMOTH_TRAP_14 = 188036, + GO_MAMMOTH_TRAP_15 = 188037, + GO_MAMMOTH_TRAP_16 = 188038, + GO_MAMMOTH_TRAP_17 = 188039, + GO_MAMMOTH_TRAP_18 = 188040, + GO_MAMMOTH_TRAP_19 = 188041, + GO_MAMMOTH_TRAP_20 = 188042, + GO_MAMMOTH_TRAP_21 = 188043, + GO_MAMMOTH_TRAP_22 = 188044, +}; + +bool ItemUse_item_dehta_trap_smasher(Player* pPlayer, Item* pItem, const SpellCastTargets &pTargets) +{ + Creature* pMammoth; + GameObject* pTrap; + + if (pPlayer->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) == QUEST_STATUS_INCOMPLETE && + (pMammoth = pPlayer->FindNearestCreature(NPC_TRAPPED_MAMMOTH_CALF,5.0f)) && + ((pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_1,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_2,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_3,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_4,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_5,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_6,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_7,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_8,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_9,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_10,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_11,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_12,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_13,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_14,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_15,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_16,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_17,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_18,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_19,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_20,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_21,5.0f)) || + (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_22,5.0f)))) + { + pMammoth->AI()->DoAction(1); + pTrap->SetGoState(GO_STATE_READY); + pPlayer->KilledMonsterCredit(NPC_TRAPPED_MAMMOTH_CALF,0); + } + + return false; +} + void AddSC_item_scripts() { Script *newscript; @@ -374,4 +444,9 @@ void AddSC_item_scripts() newscript->Name = "item_petrov_cluster_bombs"; newscript->pItemUse = &ItemUse_item_petrov_cluster_bombs; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "item_dehta_trap_smasher"; + newscript->pItemUse = &ItemUse_item_dehta_trap_smasher; + newscript->RegisterSelf(); } -- cgit v1.2.3 From 205a024d013553afe988b04b419722fac5ab1665 Mon Sep 17 00:00:00 2001 From: Tartalo Date: Wed, 17 Feb 2010 16:00:18 +0100 Subject: Fix typo --HG-- branch : trunk --- sql/updates/7373_world_creature_template.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/updates/7373_world_creature_template.sql b/sql/updates/7373_world_creature_template.sql index e7bd039ddd5..86904783abe 100644 --- a/sql/updates/7373_world_creature_template.sql +++ b/sql/updates/7373_world_creature_template.sql @@ -1,2 +1,2 @@ -UPDATE `creatyre_template` SET `scriptname`='npc_trapped_mammoth_calf' WHERE `entry`=25850; +UPDATE `creature_template` SET `scriptname`='npc_trapped_mammoth_calf' WHERE `entry`=25850; -- cgit v1.2.3 From 777a4361a0b51e3d098a23216f18d0d8e427bf75 Mon Sep 17 00:00:00 2001 From: teacher Date: Wed, 17 Feb 2010 18:34:22 +0100 Subject: Proper SQL standards. Added recently committed scriptnames to world_scripts_full.sql. --HG-- branch : trunk --- sql/FULL/world_scripts_full.sql | 2 ++ sql/updates/7349_world_spell_linked_spell.sql | 3 ++- sql/updates/7373_world_creature_template.sql | 2 -- sql/updates/7373_world_item_template.sql | 2 -- sql/updates/7373_world_scriptname.sql | 2 ++ 5 files changed, 6 insertions(+), 5 deletions(-) delete mode 100644 sql/updates/7373_world_creature_template.sql delete mode 100644 sql/updates/7373_world_item_template.sql create mode 100644 sql/updates/7373_world_scriptname.sql (limited to 'sql') diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index 40a4a20194a..8c5521b67cc 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -397,6 +397,8 @@ UPDATE `creature_template` SET `ScriptName`='npc_imprisoned_beryl_sorcerer' WHER UPDATE `creature_template` SET `ScriptName`='npc_mootoo_the_younger' WHERE `entry`= 25504; UPDATE `creature_template` SET `ScriptName`='npc_bonker_togglevolt' WHERE `entry`= 25589; UPDATE `creature_template` SET `ScriptName`='npc_fezzix_geartwist' WHERE `entry`=25849; +UPDATE `creature_template` SET `scriptname`='npc_trapped_mammoth_calf' WHERE `entry`=25850; +UPDATE `item_template` SET `scriptname`='item_dehta_trap_smasher' WHERE `entry`=35228; /* BURNING STEPPES */ UPDATE `creature_template` SET `ScriptName`='npc_ragged_john' WHERE `entry`=9563; diff --git a/sql/updates/7349_world_spell_linked_spell.sql b/sql/updates/7349_world_spell_linked_spell.sql index df64792e941..9afd55d4d50 100644 --- a/sql/updates/7349_world_spell_linked_spell.sql +++ b/sql/updates/7349_world_spell_linked_spell.sql @@ -1,2 +1,3 @@ -- Summon Water Elemental -INSERT INTO `spell_linked_spell`(`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES (31687, 70907, 0,'Summon Water Elemental'); \ No newline at end of file +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=31687 AND `spell_effect`=70907; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES (31687, 70907, 0,'Summon Water Elemental'); diff --git a/sql/updates/7373_world_creature_template.sql b/sql/updates/7373_world_creature_template.sql deleted file mode 100644 index 86904783abe..00000000000 --- a/sql/updates/7373_world_creature_template.sql +++ /dev/null @@ -1,2 +0,0 @@ -UPDATE `creature_template` SET `scriptname`='npc_trapped_mammoth_calf' WHERE `entry`=25850; - diff --git a/sql/updates/7373_world_item_template.sql b/sql/updates/7373_world_item_template.sql deleted file mode 100644 index e9c51195524..00000000000 --- a/sql/updates/7373_world_item_template.sql +++ /dev/null @@ -1,2 +0,0 @@ -UPDATE `item_template` SET `scriptname`='item_dehta_trap_smasher' WHERE `entry`=35228; - diff --git a/sql/updates/7373_world_scriptname.sql b/sql/updates/7373_world_scriptname.sql new file mode 100644 index 00000000000..3588b9b3604 --- /dev/null +++ b/sql/updates/7373_world_scriptname.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `scriptname`='npc_trapped_mammoth_calf' WHERE `entry`=25850; +UPDATE `item_template` SET `scriptname`='item_dehta_trap_smasher' WHERE `entry`=35228; -- cgit v1.2.3 From 746052f5618dab6f3d54b77ef7c656f637ae46c3 Mon Sep 17 00:00:00 2001 From: Tartalo Date: Thu, 18 Feb 2010 22:22:09 +0100 Subject: Borean Tundra: Support for quest 11560 Oh Noes, the Tadpoles! --HG-- branch : trunk --- sql/updates/7385_world_scriptname.sql | 2 ++ src/scripts/world/go_scripts.cpp | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 sql/updates/7385_world_scriptname.sql (limited to 'sql') diff --git a/sql/updates/7385_world_scriptname.sql b/sql/updates/7385_world_scriptname.sql new file mode 100644 index 00000000000..87d2b5fdb36 --- /dev/null +++ b/sql/updates/7385_world_scriptname.sql @@ -0,0 +1,2 @@ +UPDATE `gameobject_template` SET `scriptname`='go_tadpole_cage' WHERE `entry`=187373; + diff --git a/src/scripts/world/go_scripts.cpp b/src/scripts/world/go_scripts.cpp index cd71124c4f5..ee75698ddf6 100644 --- a/src/scripts/world/go_scripts.cpp +++ b/src/scripts/world/go_scripts.cpp @@ -736,6 +736,30 @@ bool GOHello_go_soulwell(Player *pPlayer, GameObject* pGO) return true; } +/*###### +## Quest 11560: Oh Noes, the Tadpoles! +## go_tadpole_cage +######*/ + +enum eTadpoles +{ + QUEST_OH_NOES_THE_TADPOLES = 11560, + NPC_WINTERFIN_TADPOLE = 25201 +}; + +bool GOHello_go_tadpole_cage(Player *pPlayer, GameObject *pGO) +{ + Creature *pTadpole; + if (pPlayer->GetQuestStatus(QUEST_OH_NOES_THE_TADPOLES) == QUEST_STATUS_INCOMPLETE && + (pTadpole = pGO->FindNearestCreature(NPC_WINTERFIN_TADPOLE,1.0f))) + { + pGO->UseDoorOrButton(); + pTadpole->DisappearAndDie(); + pPlayer->KilledMonsterCredit(NPC_WINTERFIN_TADPOLE,0); + //FIX: Summon minion tadpole + } + return true; +} void AddSC_go_scripts() { @@ -891,4 +915,9 @@ void AddSC_go_scripts() newscript->Name = "go_soulwell"; newscript->pGOHello = &GOHello_go_soulwell; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_tadpole_cage"; + newscript->pGOHello = &GOHello_go_tadpole_cage; + newscript->RegisterSelf(); } -- cgit v1.2.3 From a0fc3acdc4bcffbbcbe70ad82b02a3eec97308b2 Mon Sep 17 00:00:00 2001 From: Tartalo Date: Fri, 19 Feb 2010 00:20:14 +0100 Subject: Grizzly Hills: Support for quest 12027 Mr. Floppy's Perilous Adventure Needs db support --HG-- branch : trunk --- sql/updates/7387_world_script_texts.sql | 15 ++ sql/updates/7387_world_script_waypoints.sql | 29 ++++ sql/updates/7387_world_scriptname.sql | 2 + src/scripts/northrend/grizzly_hills.cpp | 252 ++++++++++++++++++++++++++++ 4 files changed, 298 insertions(+) create mode 100644 sql/updates/7387_world_script_texts.sql create mode 100644 sql/updates/7387_world_script_waypoints.sql create mode 100644 sql/updates/7387_world_scriptname.sql (limited to 'sql') diff --git a/sql/updates/7387_world_script_texts.sql b/sql/updates/7387_world_script_texts.sql new file mode 100644 index 00000000000..57d8cbf0fe3 --- /dev/null +++ b/sql/updates/7387_world_script_texts.sql @@ -0,0 +1,15 @@ +DELETE FROM `script_texts` WHERE `npc_entry`=26588; +INSERT INTO `script_texts` (`npc_entry`, `entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`, `sound`, `type`, `language`, `emote`, `comment`) VALUES +(26588, -1800013, 'Thank you for helping me get back to the camp. Go tell Walter that I''m safe now!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'), +(26588, -1800012, 'Are you ready, Mr. Floppy? Stay close to me and watch out for those wolves!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'), +(26588, -1800011, 'The Ravenous Worg chomps down on Mr. Floppy', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 4, 0, 0, '12027'), +(26588, -1800010, 'Mr. Floppy revives', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 4, 0, 0, '12027'), +(26588, -1800009, 'I think I see the camp! We''re almost home, Mr. Floppy! Let''s go!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'), +(26588, -1800008, 'Mr. Floppy, you''re ok! Thank you so much for saving Mr. Floppy!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'), +(26588, -1800007, 'Don''t go toward the light, Mr. Floppy!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'), +(26588, -1800006, 'Let''s get out of here before more wolves find us!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'), +(26588, -1800005, 'There''s a big meanie attacking Mr. Floppy! Help! ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'), +(26588, -1800004, 'He''s gonna eat Mr. Floppy! You gotta help Mr. Floppy! You just gotta!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'), +(26588, -1800003, 'Oh, no! Look, it''s another wolf, and it''s a biiiiiig one!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'), +(26588, -1800002, 'He''s going for Mr. Floppy! ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'), +(26588, -1800001, 'Um... I think one of those wolves is back...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'); diff --git a/sql/updates/7387_world_script_waypoints.sql b/sql/updates/7387_world_script_waypoints.sql new file mode 100644 index 00000000000..be595a30389 --- /dev/null +++ b/sql/updates/7387_world_script_waypoints.sql @@ -0,0 +1,29 @@ +DELETE FROM `script_waypoint` wHERE `entry`=26588; +INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES +(26588, 1, 4333.18, -3688.4, 263.857, 0, '0'), +(26588, 2, 4341.38, -3683.77, 257.422, 0, '0'), +(26588, 3, 4342.67, -3683.21, 257.218, 0, '0'), +(26588, 4, 4346.22, -3688.72, 257.065, 0, '0'), +(26588, 5, 4343.8, -3695.27, 257.124, 0, '0'), +(26588, 6, 4337.74, -3707.2, 257.628, 0, '0'), +(26588, 7, 4317.58, -3722.8, 256.941, 0, '0'), +(26588, 8, 4306.64, -3736.46, 258.304, 0, '0'), +(26588, 9, 4299.96, -3760.02, 254.959, 0, '0'), +(26588, 10, 4294.21, -3777.34, 249.139, 1000, '0'), +(26588, 11, 4294.37, -3776.97, 249.259, 10000, '0'), +(26588, 12, 4300.22, -3794.61, 240.107, 2000, '0'), +(26588, 13, 4307.25, -3817.76, 231.414, 2000, '0'), +(26588, 14, 4326.31, -3883.31, 208.457, 2000, '0'), +(26588, 15, 4346.19, -3905.41, 198.805, 2000, '0'), +(26588, 16, 4347.39, -3916.43, 196.716, 5000, '0'), +(26588, 17, 4350.17, -3935.03, 191.824, 1000, '0'), +(26588, 18, 4347.24, -3939.54, 191.445, 2000, '0'), +(26588, 19, 4347.24, -3939.54, 191.445, 2000, '0'), +(26588, 20, 4347.24, -3939.54, 191.445, 5000, '0'), +(26588, 21, 4347.24, -3939.54, 191.445, 7000, '0'), +(26588, 22, 4347.24, -3939.54, 191.445, 5000, '0'), +(26588, 23, 4347.24, -3939.54, 191.445, 5000, '0'), +(26588, 24, 4347.24, -3939.54, 191.445, 0, '0'), +(26588, 25, 4353.72, -3965.61, 190.154, 0, '0'), +(26588, 26, 4363.12, -3995.61, 183.327, 0, '0'), +(26588, 27, 4371.99, -4010.97, 181.33, 0, '0'); diff --git a/sql/updates/7387_world_scriptname.sql b/sql/updates/7387_world_scriptname.sql new file mode 100644 index 00000000000..2ea586552d2 --- /dev/null +++ b/sql/updates/7387_world_scriptname.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_emily' WHERE `entry`=26588; +UPDATE `creature_template` SET `ScriptName` = 'npc_mrfloppy' WHERE `entry`=26589; diff --git a/src/scripts/northrend/grizzly_hills.cpp b/src/scripts/northrend/grizzly_hills.cpp index ca1301fe287..b057faf7e5f 100644 --- a/src/scripts/northrend/grizzly_hills.cpp +++ b/src/scripts/northrend/grizzly_hills.cpp @@ -26,6 +26,7 @@ npc_orsonn_and_kodian EndContentData */ #include "ScriptedPch.h" +#include "ScriptedEscortAI.h" #define GOSSIP_ITEM1 "You're free to go Orsonn, but first tell me what's wrong with the furbolg." #define GOSSIP_ITEM2 "What happened then?" @@ -115,6 +116,246 @@ bool GossipSelect_npc_orsonn_and_kodian(Player* pPlayer, Creature* pCreature, ui return true; } +/*###### +## Quest 12027: Mr. Floppy's Perilous Adventure +######*/ + +enum eFloppy +{ + NPC_MRFLOPPY = 26589, + NPC_HUNGRY_WORG = 26586, + NPC_RAVENOUS_WORG = 26590, //RWORG + NPC_EMILY = 26588, + + QUEST_PERILOUS_ADVENTURE = 12027, + + SPELL_MRFLOPPY = 47184, //vehicle aura + + SAY_WORGHAGGRO1 = -1800001, //Um... I think one of those wolves is back... + SAY_WORGHAGGRO2 = -1800002, //He's going for Mr. Floppy! + SAY_WORGRAGGRO3 = -1800003, //Oh, no! Look, it's another wolf, and it's a biiiiiig one! + SAY_WORGRAGGRO4 = -1800004, //He's gonna eat Mr. Floppy! You gotta help Mr. Floppy! You just gotta! + SAY_RANDOMAGGRO = -1800005, //There's a big meanie attacking Mr. Floppy! Help! + SAY_VICTORY1 = -1800006, //Let's get out of here before more wolves find us! + SAY_VICTORY2 = -1800007, //Don't go toward the light, Mr. Floppy! + SAY_VICTORY3 = -1800008, //Mr. Floppy, you're ok! Thank you so much for saving Mr. Floppy! + SAY_VICTORY4 = -1800009, //I think I see the camp! We're almost home, Mr. Floppy! Let's go! + TEXT_EMOTE_WP1 = -1800010, //Mr. Floppy revives + TEXT_EMOTE_AGGRO = -1800011, //The Ravenous Worg chomps down on Mr. Floppy + SAY_QUEST_ACCEPT = -1800012, //Are you ready, Mr. Floppy? Stay close to me and watch out for those wolves! + SAY_QUEST_COMPLETE = -1800013 //Thank you for helping me get back to the camp. Go tell Walter that I'm safe now! +}; + +//emily +struct npc_emilyAI : public npc_escortAI +{ + npc_emilyAI(Creature* pCreature) : npc_escortAI(pCreature) { } + + uint32 m_uiChatTimer; + + uint64 RWORGGUID; + uint64 MrfloppyGUID; + + Creature* Mrfloppy; + Creature* RWORG; + bool Completed; + + + void JustSummoned(Creature* pSummoned) + { + if (Creature* Mrfloppy = GetClosestCreatureWithEntry(m_creature, NPC_MRFLOPPY, 50.0f)) + pSummoned->AI()->AttackStart(Mrfloppy); + else + pSummoned->AI()->AttackStart(m_creature->getVictim()); + } + + void WaypointReached(uint32 i) + { + Player* pPlayer = GetPlayerForEscort(); + if (!pPlayer) + return; + switch (i) + { + case 9: + Mrfloppy = GetClosestCreatureWithEntry(m_creature, NPC_MRFLOPPY, 100.0f); + break; + case 10: + if (Mrfloppy) + { + DoScriptText(SAY_WORGHAGGRO1, m_creature); + m_creature->SummonCreature(NPC_HUNGRY_WORG,m_creature->GetPositionX()+5,m_creature->GetPositionY()+2,m_creature->GetPositionZ()+1,3.229f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000); + } + break; + case 11: + Mrfloppy->GetMotionMaster()->MoveFollow(m_creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); + break; + case 17: + Mrfloppy->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + DoScriptText(SAY_WORGRAGGRO3, m_creature); + RWORG = m_creature->SummonCreature(NPC_RAVENOUS_WORG,m_creature->GetPositionX()+10,m_creature->GetPositionY()+8,m_creature->GetPositionZ()+2,3.229f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000); + RWORG->setFaction(35); + break; + case 18: + if (Mrfloppy) + { + RWORG->GetMotionMaster()->MovePoint(0, Mrfloppy->GetPositionX(), Mrfloppy->GetPositionY(), Mrfloppy->GetPositionZ()); + DoCast(Mrfloppy,SPELL_MRFLOPPY); + } + break; + case 19: + if (Mrfloppy->HasAura(SPELL_MRFLOPPY, 0)) + Mrfloppy->EnterVehicle(RWORG); + break; + case 20: + if (Mrfloppy) + RWORG->HandleEmoteCommand(34); + break; + case 21: + if (Mrfloppy) + { + RWORG->Kill(Mrfloppy); + Mrfloppy->ExitVehicle(); + RWORG->setFaction(14); + RWORG->GetMotionMaster()->MovePoint(0, RWORG->GetPositionX()+10,RWORG->GetPositionY()+80,RWORG->GetPositionZ()); + DoScriptText(SAY_VICTORY2, m_creature); + } + break; + case 22: + if (Mrfloppy && Mrfloppy->isDead()) + { + RWORG->DisappearAndDie(); + m_creature->GetMotionMaster()->MovePoint(0, Mrfloppy->GetPositionX(), Mrfloppy->GetPositionY(), Mrfloppy->GetPositionZ()); + Mrfloppy->setDeathState(ALIVE); + Mrfloppy->GetMotionMaster()->MoveFollow(m_creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); + DoScriptText(SAY_VICTORY3, m_creature); + } + break; + case 24: + if (pPlayer) + { + Completed = true; + pPlayer->GroupEventHappens(QUEST_PERILOUS_ADVENTURE, m_creature); + DoScriptText(SAY_QUEST_COMPLETE, m_creature, pPlayer); + } + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + break; + case 25: + DoScriptText(SAY_VICTORY4, m_creature); + break; + case 27: + m_creature->DisappearAndDie(); + if (Mrfloppy) + Mrfloppy->DisappearAndDie(); + break; + } + } + + void EnterCombat(Unit* Who) + { + DoScriptText(SAY_RANDOMAGGRO, m_creature); + } + + void Reset() + { + m_uiChatTimer = 4000; + Mrfloppy = NULL; + RWORG = NULL; + } + + void UpdateAI(const uint32 uiDiff) + { + npc_escortAI::UpdateAI(uiDiff); + + if (HasEscortState(STATE_ESCORT_ESCORTING)) + { + if (m_uiChatTimer <= uiDiff) + { + m_uiChatTimer = 12000; + } + else + m_uiChatTimer -= uiDiff; + } + } +}; + + +bool QuestAccept_npc_emily(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_PERILOUS_ADVENTURE) + { + DoScriptText(SAY_QUEST_ACCEPT, pCreature); + if (Creature* Mrfloppy = GetClosestCreatureWithEntry(pCreature, NPC_MRFLOPPY, 180.0f)) + { + Mrfloppy->GetMotionMaster()->MoveFollow(pCreature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); + } + + if (npc_escortAI* pEscortAI = CAST_AI(npc_emilyAI, (pCreature->AI()))) + pEscortAI->Start(true, false, pPlayer->GetGUID()); + } + return true; +} + +CreatureAI* GetAI_npc_emily(Creature* pCreature) +{ + return new npc_emilyAI(pCreature); +} + +//mrfloppy + +struct npc_mrfloppyAI : public ScriptedAI +{ + npc_mrfloppyAI(Creature *c) : ScriptedAI(c) {} + + uint64 EmilyGUID; + uint64 RWORGGUID; + uint64 HWORGGUID; + + Creature* HWORG; + Creature* RWORG; + + Creature* Emily; + + void Reset() + { + HWORG = NULL; + RWORG = NULL; + Emily = NULL; + } + + void EnterCombat(Unit* Who) + { + if (Creature* Emily = GetClosestCreatureWithEntry(m_creature, NPC_EMILY, 50.0f)) + { + switch(Who->GetEntry()) + { + case NPC_HUNGRY_WORG: + DoScriptText(SAY_WORGHAGGRO2, Emily); + break; + case NPC_RAVENOUS_WORG: + DoScriptText(SAY_WORGRAGGRO4, Emily); + break; + default: + DoScriptText(SAY_RANDOMAGGRO, Emily); + } + } + } + + void EnterEvadeMode() {} + + void MoveInLineOfSight(Unit *who) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + } +}; + +CreatureAI* GetAI_npc_mrfloppy(Creature* pCreature) +{ + return new npc_mrfloppyAI(pCreature); +} + void AddSC_grizzly_hills() { Script* newscript; @@ -124,4 +365,15 @@ void AddSC_grizzly_hills() newscript->pGossipHello = &GossipHello_npc_orsonn_and_kodian; newscript->pGossipSelect = &GossipSelect_npc_orsonn_and_kodian; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_emily"; + newscript->GetAI = &GetAI_npc_emily; + newscript->pQuestAccept = &QuestAccept_npc_emily; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_mrfloppy"; + newscript->GetAI = &GetAI_npc_mrfloppy; + newscript->RegisterSelf(); } -- cgit v1.2.3 From 1da4996189c402f8176b561abc770df0feab0630 Mon Sep 17 00:00:00 2001 From: _manuel_ Date: Fri, 19 Feb 2010 15:12:46 -0800 Subject: Razorfen downs: Implemented event from boss Tuten'kash. For a full fix see TDB Forums. --HG-- branch : trunk --- sql/updates/7390_world_scriptname.sql | 4 + src/game/ScriptLoader.cpp | 2 + src/scripts/CMakeLists.txt | 2 + .../razorfen_downs/instance_razorfen_downs.cpp | 215 +++++++++++++++++++++ .../kalimdor/razorfen_downs/razorfen_downs.cpp | 80 ++++++++ .../kalimdor/razorfen_downs/razorfen_downs.h | 45 +++++ win/VC90/game.vcproj | 60 +++--- 7 files changed, 382 insertions(+), 26 deletions(-) create mode 100644 sql/updates/7390_world_scriptname.sql create mode 100644 src/scripts/kalimdor/razorfen_downs/instance_razorfen_downs.cpp create mode 100644 src/scripts/kalimdor/razorfen_downs/razorfen_downs.h (limited to 'sql') diff --git a/sql/updates/7390_world_scriptname.sql b/sql/updates/7390_world_scriptname.sql new file mode 100644 index 00000000000..0c82857311d --- /dev/null +++ b/sql/updates/7390_world_scriptname.sql @@ -0,0 +1,4 @@ +UPDATE `gameobject_template` SET `ScriptName`='go_gong' WHERE `entry`=148917; +UPDATE `creature_template` SET `ScriptName`='npc_tomb_creature' WHERE `entry` IN (7351,7349); +UPDATE `instance_template` SET `script`='instance_razorfen_downs' WHERE `map`=129; + diff --git a/src/game/ScriptLoader.cpp b/src/game/ScriptLoader.cpp index 60814ce6c83..df4c9a251fc 100644 --- a/src/game/ScriptLoader.cpp +++ b/src/game/ScriptLoader.cpp @@ -238,6 +238,7 @@ void AddSC_boss_ptheradras(); void AddSC_boss_onyxia(); //Onyxia's Lair void AddSC_boss_amnennar_the_coldbringer(); //Razorfen Downs void AddSC_razorfen_downs(); +void AddSC_instance_razorfen_downs(); void AddSC_razorfen_kraul(); //Razorfen Kraul void AddSC_boss_kurinnaxx(); //Ruins of ahn'qiraj void AddSC_boss_rajaxx(); @@ -702,6 +703,7 @@ void AddScripts() AddSC_boss_onyxia(); //Onyxia's Lair AddSC_boss_amnennar_the_coldbringer(); //Razorfen Downs AddSC_razorfen_downs(); + AddSC_instance_razorfen_downs(); AddSC_razorfen_kraul(); //Razorfen Kraul AddSC_boss_kurinnaxx(); //Ruins of ahn'qiraj AddSC_boss_rajaxx(); diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index 6fc29306a27..a94f6daafa2 100644 --- a/src/scripts/CMakeLists.txt +++ b/src/scripts/CMakeLists.txt @@ -253,6 +253,8 @@ SET(scripts_STAT_SRCS kalimdor/onyxias_lair/boss_onyxia.cpp kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp kalimdor/razorfen_downs/razorfen_downs.cpp + kalimdor/razorfen_downs/instance_razorfen_downs.cpp + kalimdor/razorfen_downs/razorfen_downs.h kalimdor/razorfen_kraul/razorfen_kraul.h kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp kalimdor/razorfen_kraul/razorfen_kraul.cpp diff --git a/src/scripts/kalimdor/razorfen_downs/instance_razorfen_downs.cpp b/src/scripts/kalimdor/razorfen_downs/instance_razorfen_downs.cpp new file mode 100644 index 00000000000..8ac8073e1f1 --- /dev/null +++ b/src/scripts/kalimdor/razorfen_downs/instance_razorfen_downs.cpp @@ -0,0 +1,215 @@ +/* + * Copyright (C) 2010 Trinity + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "ScriptedPch.h" +#include "razorfen_downs.h" + +#define MAX_ENCOUNTER 1 + +struct instance_razorfen_downs : public ScriptedInstance +{ + instance_razorfen_downs(Map* pMap) : ScriptedInstance(pMap) + { + Initialize(); + }; + + uint64 uiGongGUID; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint8 uiGongWaves; + + std::string str_data; + + void Initialize() + { + uiGongGUID = 0; + + uiGongWaves = 0; + + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + + saveStream << "T C " << m_auiEncounter[0] + << " " << uiGongWaves; + + str_data = saveStream.str(); + + OUT_SAVE_INST_DATA_COMPLETE; + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + char dataHead1, dataHead2; + uint16 data0, data1; + + std::istringstream loadStream(in); + loadStream >> dataHead1 >> dataHead2 >> data0 >> data1; + + if (dataHead1 == 'T' && dataHead2 == 'C') + { + m_auiEncounter[0] = data0; + + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + uiGongWaves = data1; + } else OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } + + void OnGameObjectCreate(GameObject* pGo, bool bAdd) + { + switch(pGo->GetEntry()) + { + case GO_GONG: + uiGongGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); + break; + default: + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + if (uiType == DATA_GONG_WAVES) + { + uiGongWaves = uiData; + + switch(uiGongWaves) + { + case 9: + case 14: + if (GameObject* pGo = instance->GetGameObject(uiGongGUID)) + pGo->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); + break; + case 1: + case 10: + case 16: + { + GameObject* pGo = instance->GetGameObject(uiGongGUID); + + if (!pGo) + return; + + pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); + + uint32 uiCreature = 0; + uint8 uiSummonTimes = 0; + + switch(uiGongWaves) + { + case 1: + uiCreature = CREATURE_TOMB_FIEND; + uiSummonTimes = 7; + break; + case 10: + uiCreature = CREATURE_TOMB_REAVER; + uiSummonTimes = 3; + break; + case 16: + uiCreature = CREATURE_TUTEN_KASH; + break; + default: + break; + } + + + if (Creature* pCreature = pGo->SummonCreature(uiCreature,2502.635,844.140,46.896,0.633)) + { + if (uiGongWaves == 10 || uiGongWaves == 1) + { + for (uint8 i = 0; i < uiSummonTimes; ++i) + { + if (Creature* pSummon = pGo->SummonCreature(uiCreature,2502.635 + float(irand(-5,5)),844.140 + float(irand(-5,5)),46.896,0.633)) + pSummon->GetMotionMaster()->MovePoint(0,2533.479 + float(irand(-5,5)),870.020 + float(irand(-5,5)),47.678); + } + } + pCreature->GetMotionMaster()->MovePoint(0,2533.479 + float(irand(-5,5)),870.020 + float(irand(-5,5)),47.678); + } + break; + } + default: + break; + } + } + + if (uiType == BOSS_TUTEN_KASH) + { + m_auiEncounter[0] = uiData; + + if (uiData == DONE) + SaveToDB(); + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case DATA_GONG_WAVES: + return uiGongWaves; + } + + return 0; + } + + uint64 GetData64(uint32 uiType) + { + switch(uiType) + { + case DATA_GONG: return uiGongGUID; + } + + return 0; + } +}; + +InstanceData* GetInstanceData_instance_razorfen_downs(Map* pMap) +{ + return new instance_razorfen_downs(pMap); +} + +void AddSC_instance_razorfen_downs() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "instance_razorfen_downs"; + newscript->GetInstanceData = &GetInstanceData_instance_razorfen_downs; + newscript->RegisterSelf(); +} diff --git a/src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp b/src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp index 7160524ff65..d8ffb63a3a7 100644 --- a/src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp +++ b/src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp @@ -26,6 +26,7 @@ npc_henry_stern EndContentData */ #include "ScriptedPch.h" +#include "razorfen_downs.h" /*### # npc_henry_stern @@ -73,6 +74,75 @@ bool GossipSelect_npc_henry_stern (Player* pPlayer, Creature* pCreature, uint32 return true; } +/*###### +## go_gong +######*/ + +bool GOHello_go_gong(Player* pPlayer, GameObject* pGO) +{ + //basic support, not blizzlike data is missing... + ScriptedInstance* pInstance = pGO->GetInstanceData(); + + if (pInstance) + { + pInstance->SetData(DATA_GONG_WAVES,pInstance->GetData(DATA_GONG_WAVES)+1); + return true; + } + + return false; +} + +enum eTombCreature +{ + SPELL_WEB = 745 +}; + +struct npc_tomb_creatureAI : public ScriptedAI +{ + npc_tomb_creatureAI(Creature* pCreature) : ScriptedAI(pCreature) + { + pInstance = pCreature->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 uiWebTimer; + + void Reset() + { + uiWebTimer = urand(5000,8000); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + //from acid + if (m_creature->GetEntry() == CREATURE_TOMB_REAVER) + { + if (uiWebTimer <= uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_WEB); + uiWebTimer = urand(7000,16000); + } else uiWebTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* pKiller) + { + if (pInstance) + pInstance->SetData(DATA_GONG_WAVES,pInstance->GetData(DATA_GONG_WAVES)+1); + } +}; + +CreatureAI* GetAI_npc_tomb_creature(Creature* pCreature) +{ + return new npc_tomb_creatureAI (pCreature); +} + void AddSC_razorfen_downs() { Script* newscript; @@ -82,4 +152,14 @@ void AddSC_razorfen_downs() newscript->pGossipHello = &GossipHello_npc_henry_stern; newscript->pGossipSelect = &GossipSelect_npc_henry_stern; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_gong"; + newscript->pGOHello = &GOHello_go_gong; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_tomb_creature"; + newscript->GetAI = &GetAI_npc_tomb_creature; + newscript->RegisterSelf(); } diff --git a/src/scripts/kalimdor/razorfen_downs/razorfen_downs.h b/src/scripts/kalimdor/razorfen_downs/razorfen_downs.h new file mode 100644 index 00000000000..d1c95d3f305 --- /dev/null +++ b/src/scripts/kalimdor/razorfen_downs/razorfen_downs.h @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2010 Trinity + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef DEF_RAZORFEN_DOWNS_H +#define DEF_RAZORFEN_DOWNS_H + +enum eData +{ + BOSS_TUTEN_KASH, + DATA_GONG_WAVES +}; + +enum eData64 +{ + DATA_GONG +}; + +enum eGameObject +{ + GO_GONG = 148917 +}; + +enum eCreature +{ + CREATURE_TOMB_FIEND = 7349, + CREATURE_TOMB_REAVER = 7351, + CREATURE_TUTEN_KASH = 7355 +}; + +#endif diff --git a/win/VC90/game.vcproj b/win/VC90/game.vcproj index c54c46012a2..bddf1189edd 100644 --- a/win/VC90/game.vcproj +++ b/win/VC90/game.vcproj @@ -104,7 +104,7 @@ /> @@ -188,7 +185,7 @@ /> @@ -2888,10 +2888,18 @@ RelativePath="..\..\src\scripts\kalimdor\razorfen_downs\boss_amnennar_the_coldbringer.cpp" > + + + + - @@ -4152,7 +4160,7 @@ /> Date: Fri, 19 Feb 2010 18:02:42 -0300 Subject: Added missing sentences. Thanks JuliuSZS. --HG-- branch : trunk --- sql/FULL/world_scripts_full.sql | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sql') diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index 8c5521b67cc..b06d5a4cca2 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -913,6 +913,9 @@ UPDATE `gameobject_template` SET `ScriptName`='go_blood_filled_orb' WHERE `entry /* RAZORFEN DOWNS */ UPDATE `creature_template` SET `ScriptName`='boss_amnennar_the_coldbringer' WHERE `entry`=7358; UPDATE `creature_template` SET `ScriptName`='npc_henry_stern' WHERE `entry`=8696; +UPDATE `creature_template` SET `ScriptName`='npc_tomb_creature' WHERE `entry` IN (7351,7349); +UPDATE `instance_template` SET `script`='instance_razorfen_downs' WHERE `map`=129; +UPDATE `gameobject_template` SET `ScriptName`='go_gong' WHERE `entry`=148917; /* RAZORFEN KRAUL */ UPDATE `creature_template` SET `Scriptname`='npc_willix' WHERE `entry`=4508; -- cgit v1.2.3 From 8e146c309de73160252ae538689d28660273d459 Mon Sep 17 00:00:00 2001 From: Xanadu Date: Sat, 20 Feb 2010 19:58:52 +0100 Subject: Fixed some spell bonuses as commanded by thenecromancer. --HG-- branch : trunk --- sql/updates/7394_world_spell_bonus_data.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 sql/updates/7394_world_spell_bonus_data.sql (limited to 'sql') diff --git a/sql/updates/7394_world_spell_bonus_data.sql b/sql/updates/7394_world_spell_bonus_data.sql new file mode 100644 index 00000000000..a6f7717201c --- /dev/null +++ b/sql/updates/7394_world_spell_bonus_data.sql @@ -0,0 +1,17 @@ +-- Some spell bonus data mostly for DK spells and trinket spells +DELETE FROM `spell_bonus_data` WHERE `entry` IN (63544,54181,55078,55095,50536,52212,51460,48721,45477,54757,45055,60203,60488,45429); +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(63544, 0, -1, -1, -1, 'Priest - Empowered Renew'), +(54181, 0, -1, -1, -1, 'Warlock - Fel Synergy'), +(55078, 0, 0, -1, 0.06325, 'Death Knight - Blood Plague'), +(55095, -1, 0, -1, 0.06325, 'Death Knight - Frost Fever'), +(50536, -1, 0, -1, -1, 'Death Knight - Unholy Blight (Rank 1)'), +(52212, 0, -1, 0.0475, -1, 'Death Knight - Death and Decay'), +(51460, 0, -1, -1, -1, 'Death Knight - Necrosis'), +(48721, 0, -1, 0.04, -1, 'Death Knight - Blood Boil'), +(45477, 0, -1, 0.1, -1, 'Death Knight - Icy Touch'), +(54757, 0, -1, -1, -1, 'Hand-Mounted Pyro Rocket - Pyro Rocket'), +(45055, 0, -1, -1, -1, 'Timbal\'s Focusing Crystal - Shadow Bolt'), +(60203, 0, -1, -1, -1, 'Darkmoon Card: Death'), +(60488, 0, -1, -1, -1, 'Extract of Necromatic Power'), +(45429, 0, -1, -1, -1, 'Shattered Sun Pendant of Acumen - Arcane Bolt'); -- cgit v1.2.3