summaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authoravarishd <46330494+avarishd@users.noreply.github.com>2023-10-11 02:25:26 +0300
committerGitHub <noreply@github.com>2023-10-10 20:25:26 -0300
commit5aca484574bdca3cb46aeb6fbc4b6dbac51227ca (patch)
tree7d157f025106fd957d5dace64c802c692845ed27 /src/server/scripts
parent99a0d2923a70cc44b6b7dea519c082ac41510790 (diff)
fix(Core/Scripts): Venomhide Hatchling improvements (#17454)
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Spells/spell_item.cpp59
-rw-r--r--src/server/scripts/World/npcs_special.cpp6
2 files changed, 62 insertions, 3 deletions
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index 17d9156e98..584e389bb2 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<Creature*> 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<Creature*> 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 3092303258..7a13b68815 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