diff --git a/data/sql/updates/pending_db_world/rev_1696761835374043300.sql b/data/sql/updates/pending_db_world/rev_1696761835374043300.sql new file mode 100644 index 000000000..b05584d6e --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1696761835374043300.sql @@ -0,0 +1,29 @@ +-- Venomhide Hatchling feed items +DELETE FROM `spell_script_names` WHERE `spell_id` IN (65200,65258,65265,68359,68358,68360); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(65200, 'spell_item_venomhide_feed'), +(65258, 'spell_item_venomhide_feed'), +(65265, 'spell_item_venomhide_feed'), +(68359, 'spell_item_venomhide_feed'), +(68358, 'spell_item_venomhide_feed'), +(68360, 'spell_item_venomhide_feed'); + +-- Mor'vek +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 11701; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 11701); +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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(11701, 0, 0, 0, 20, 0, 100, 0, 13906, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 19, 34320, 10, 0, 0, 0, 0, 0, 0, 'Mor\'vek - On Quest \'They Grow Up So Fast\' Finished - Despawn Closest Venomhide Hatchling'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 13 AND `SourceGroup` = 1 AND `SourceEntry` IN (65200,65258,65265); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 19 AND `SourceGroup` = 0 AND `ConditionTypeOrReference` = 9 AND `ConditionValue1` = 13906; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(19, 0, 13903, 0, 0, 9, 0, 13906, 0, 0, 0, 0, 0, '', 'Show quest \'Gorishi Grub\' only if on quest \'They Grow Up So Fast\''), +(19, 0, 13917, 0, 0, 9, 0, 13906, 0, 0, 0, 0, 0, '', 'Show quest \'Gorishi Grub\' only if on quest \'They Grow Up So Fast\''), +(19, 0, 13889, 0, 0, 9, 0, 13906, 0, 0, 0, 0, 0, '', 'Show quest \'Hungry, Hungry Hatchling\' only if on quest \'They Grow Up So Fast\''), +(19, 0, 13915, 0, 0, 9, 0, 13906, 0, 0, 0, 0, 0, '', 'Show quest \'Hungry, Hungry Hatchling\' only if on quest \'They Grow Up So Fast\''), +(19, 0, 13904, 0, 0, 9, 0, 13906, 0, 0, 0, 0, 0, '', 'Show quest \'Poached, Scrambled, Or Raw?\' only if on quest \'They Grow Up So Fast\''), +(19, 0, 13916, 0, 0, 9, 0, 13906, 0, 0, 0, 0, 0, '', 'Show quest \'Poached, Scrambled, Or Raw?\' only if on quest \'They Grow Up So Fast\''), +(19, 0, 13905, 0, 0, 9, 0, 13906, 0, 0, 0, 0, 0, '', 'Show quest \'Searing Roc Feathers\' only if on quest \'They Grow Up So Fast\''), +(19, 0, 13914, 0, 0, 9, 0, 13906, 0, 0, 0, 0, 0, '', 'Show quest \'Searing Roc Feathers\' only if on quest \'They Grow Up So Fast\''); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 17d9156e9..584e389bb 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -3883,6 +3883,64 @@ class spell_item_worn_troll_dice : public SpellScript } }; +enum VenomhideHatchling +{ + NPC_VENOMHIDE_HATCHLING = 34320 +}; + +class spell_item_venomhide_feed : public SpellScript +{ + PrepareSpellScript(spell_item_venomhide_feed) + + SpellCastResult CheckCast() + { + if (Player* player = GetCaster()->ToPlayer()) + { + std::list hatchling; + player->GetAllMinionsByEntry(hatchling, NPC_VENOMHIDE_HATCHLING); + if (!hatchling.empty()) + { + return SPELL_CAST_OK; + } + } + + return SPELL_FAILED_BAD_TARGETS; + } + + void UpdateTarget(WorldObject*& target) + { + if (!target) + { + return; + } + + if (Player* player = GetCaster()->ToPlayer()) + { + std::list hatchling; + player->GetAllMinionsByEntry(hatchling, NPC_VENOMHIDE_HATCHLING); + if (hatchling.empty()) + { + return; + } + + for (Creature* creature : hatchling) + { + if (creature) + { + target = creature; + return; + } + } + } + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_item_venomhide_feed::CheckCast); + OnObjectTargetSelect += SpellObjectTargetSelectFn(spell_item_venomhide_feed::UpdateTarget, EFFECT_0, TARGET_UNIT_NEARBY_ENTRY); + } +}; + void AddSC_item_spell_scripts() { RegisterSpellScript(spell_item_massive_seaforium_charge); @@ -4003,4 +4061,5 @@ void AddSC_item_spell_scripts() RegisterSpellScript(spell_item_green_whelp_armor); RegisterSpellScript(spell_item_elixir_of_shadows); RegisterSpellScript(spell_item_worn_troll_dice); + RegisterSpellScript(spell_item_venomhide_feed); } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 309230325..7a13b6881 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -2506,9 +2506,9 @@ enum VenomhideHatchlingMisc ITEM_VENOMHIDE_BABY_TOOTH = 47196, MODEL_BABY_RAPTOR = 29251, - MODEL_BABY_RAPTOR_REPTILE_EYES = 29809, - MODEL_ADOLESCENT_RAPTOR = 29103, - MODEL_FULL_RAPTOR = 5291, + MODEL_BABY_RAPTOR_REPTILE_EYES = 29274, + MODEL_ADOLESCENT_RAPTOR = 29275, + MODEL_FULL_RAPTOR = 29276, }; enum VenomhideHatchlingTexts