Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
razorfen_downs.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6/* ScriptData
7SDName: Razorfen_Downs
8SD%Complete: 100
9SDComment: Support for Henry Stern(2 recipes)
10SDCategory: Razorfen Downs
11EndScriptData */
12
13/* ContentData
14npc_henry_stern
15EndContentData */
16
17#include "ScriptMgr.h"
18#include "ScriptedCreature.h"
19#include "ScriptedGossip.h"
20#include "razorfen_downs.h"
21#include "Player.h"
22
23/*###
24# npc_henry_stern
25####*/
26
32
40
42{
43public:
44 npc_henry_stern() : CreatureScript("npc_henry_stern") { }
45
47 {
48 npc_henry_sternAI(Creature* creature) : ScriptedAI(creature) { }
49
50 void sGossipSelect(Player* player, uint32 /*sender*/, uint32 action) OVERRIDE
51 {
52 if (action == 0)
53 {
54 if (player->GetBaseSkillValue(SKILL_COOKING) >= 175)
55 {
56 player->PrepareGossipMenu(me, GOSSIP_COOKING_SKILL_HIGH);
57 player->SendPreparedGossip(me);
59 }
60 else
61 {
62 player->PrepareGossipMenu(me, GOSSIP_COOKING_SKILL_LOW);
63 player->SendPreparedGossip(me);
64 }
65 }
66
67 if (action == 1)
68 {
69 if (player->GetBaseSkillValue(SKILL_ALCHEMY) >= 180)
70 {
71 player->PrepareGossipMenu(me, GOSSIP_ALCHEMY_SKILL_HIGH);
72 player->SendPreparedGossip(me);
74 }
75 else
76 {
77 player->PrepareGossipMenu(me, GOSSIP_ALCHEMY_SKILL_LOW);
78 player->SendPreparedGossip(me);
79 }
80 }
81 }
82 };
83
85 {
86 return new npc_henry_sternAI(creature);
87 }
88};
89
90/*######
91## go_gong
92######*/
93
95{
96public:
97 go_gong() : GameObjectScript("go_gong") { }
98
99 bool OnGossipHello(Player* /*player*/, GameObject* go) OVERRIDE
100 {
101 //basic support, not blizzlike data is missing...
102 InstanceScript* instance = go->GetInstanceScript();
103
104 if (instance)
105 {
106 instance->SetData(DATA_GONG_WAVES, instance->GetData(DATA_GONG_WAVES)+1);
107 return true;
108 }
109
110 return false;
111 }
112};
113
115{
117};
118
120{
121public:
122 npc_tomb_creature() : CreatureScript("npc_tomb_creature") { }
123
125 {
126 return new npc_tomb_creatureAI(creature);
127 }
128
130 {
132 {
133 instance = creature->GetInstanceScript();
134 }
135
137
139
141 {
142 uiWebTimer = std::rand() % 8000 + 5000;
143 }
144
146 {
147 if (!UpdateVictim())
148 return;
149
150 //from acid
151 if (me->GetEntry() == NPC_TOMB_REAVER)
152 {
153 if (uiWebTimer <= uiDiff)
154 {
156 uiWebTimer = std::rand() % 16000 + 7000;
157 } else uiWebTimer -= uiDiff;
158 }
159
161 }
162
163 void JustDied(Unit* /*killer*/) OVERRIDE
164 {
165 if (instance)
166 instance->SetData(DATA_GONG_WAVES, instance->GetData(DATA_GONG_WAVES)+1);
167 }
168 };
169};
170
172{
173 new npc_henry_stern();
174 new go_gong();
175 new npc_tomb_creature();
176}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ SKILL_COOKING
@ SKILL_ALCHEMY
bool UpdateVictim()
CreatureScript(const char *name)
GameObjectScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:36
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:37
bool OnGossipHello(Player *, GameObject *go) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ SPELL_WEB
@ GOSSIP_COOKING_SKILL_LOW
@ GOSSIP_COOKING_SKILL_HIGH
@ GOSSIP_ALCHEMY_SKILL_HIGH
@ GOSSIP_ALCHEMY_SKILL_LOW
@ SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION
@ SPELL_TEACHING_GOLDTHORN_TEA
void AddSC_razorfen_downs()
TombCreature
@ SPELL_WEB
@ NPC_TOMB_REAVER
@ DATA_GONG_WAVES
Creature * me
ScriptedAI(Creature *creature)
void sGossipSelect(Player *player, uint32, uint32 action) OVERRIDE
void UpdateAI(uint32 uiDiff) OVERRIDE
== Triggered Actions Requested ==================