aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Northrend
diff options
context:
space:
mode:
authorWyrserth <wyrserth@protonmail.com>2019-07-17 19:32:07 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-16 21:20:39 +0100
commit96bca1fe2b690a16e741d8675f6d1f6d4467739b (patch)
treecea495a34e47a04dd74383c3fdab18995886b2b4 /src/server/scripts/Northrend
parent1f8a6bac87e726f580247a601391e6286017468c (diff)
Script/BoreanTundra: move Pile of Fake Furs' script (related to quest Unfit for Death) from ItemScript to SpellScript.
Closes #21890. (cherry picked from commit e7cf24d2630058128e556b7d5bbb36f4a810695f)
Diffstat (limited to 'src/server/scripts/Northrend')
-rw-r--r--src/server/scripts/Northrend/zone_borean_tundra.cpp43
1 files changed, 39 insertions, 4 deletions
diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp
index 4a85c8c421d..6d488fd5112 100644
--- a/src/server/scripts/Northrend/zone_borean_tundra.cpp
+++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp
@@ -395,12 +395,10 @@ public:
}
};
-/*######
-## npc_nesingwary_trapper
-######*/
-
enum NesingwaryTrapper
{
+ NPC_NESINGWARY_TRAPPER = 25835,
+
GO_HIGH_QUALITY_FUR = 187983,
GO_CARIBOU_TRAP_1 = 187982,
@@ -430,6 +428,42 @@ const uint32 CaribouTraps[CaribouTrapsNum] =
GO_CARIBOU_TRAP_11, GO_CARIBOU_TRAP_12, GO_CARIBOU_TRAP_13, GO_CARIBOU_TRAP_14, GO_CARIBOU_TRAP_15,
};
+class spell_q11865_place_fake_fur : public SpellScript
+{
+ PrepareSpellScript(spell_q11865_place_fake_fur);
+
+ bool Load() override
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void ActivateGameObject(SpellEffIndex effIndex)
+ {
+ PreventHitDefaultEffect(effIndex);
+ GameObject* go = GetHitGObj();
+ Player* player = GetCaster()->ToPlayer();
+
+ if (go->FindNearestCreature(NPC_NESINGWARY_TRAPPER, 10.0f, true) || go->FindNearestCreature(NPC_NESINGWARY_TRAPPER, 10.0f, false) || go->FindNearestGameObject(GO_HIGH_QUALITY_FUR, 2.0f))
+ return;
+
+ float x, y, z;
+ go->GetClosePoint(x, y, z, go->GetCombatReach() / 3, 7.0f);
+
+ go->SummonGameObject(GO_HIGH_QUALITY_FUR, go->GetPosition(), QuaternionData::fromEulerAnglesZYX(go->GetOrientation(), 0.0f, 0.0f), 20);
+ if (TempSummon* summon = player->SummonCreature(NPC_NESINGWARY_TRAPPER, x, y, z, go->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 1000))
+ {
+ summon->SetVisible(false);
+ summon->SetReactState(REACT_PASSIVE);
+ summon->SetImmuneToPC(true);
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q11865_place_fake_fur::ActivateGameObject, EFFECT_0, SPELL_EFFECT_ACTIVATE_OBJECT);
+ }
+};
+
class npc_nesingwary_trapper : public CreatureScript
{
public:
@@ -2555,6 +2589,7 @@ void AddSC_borean_tundra()
new npc_corastrasza();
new npc_iruk();
new npc_nerubar_victim();
+ RegisterSpellScript(spell_q11865_place_fake_fur);
new npc_nesingwary_trapper();
new npc_lurgglbr();
new spell_red_dragonblood();