TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
npc_wg_demolisher_engineer Class Reference

Public Member Functions

 npc_wg_demolisher_engineer ()
 
bool OnGossipHello (Player *player, Creature *creature) override
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 action) override
 
- Public Member Functions inherited from CreatureScript
virtual bool OnDummyEffect (Unit *, uint32, SpellEffIndex, Creature *)
 
virtual bool OnGossipSelectCode (Player *, Creature *, uint32, uint32, const char *)
 
virtual bool OnQuestAccept (Player *, Creature *, Quest const *)
 
virtual bool OnQuestSelect (Player *, Creature *, Quest const *)
 
virtual bool OnQuestReward (Player *, Creature *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, Creature *)
 
virtual CreatureAIGetAI (Creature *) const
 
- Public Member Functions inherited from UnitScript
virtual void OnHeal (Unit *, Unit *, uint32 &)
 
virtual void OnDamage (Unit *, Unit *, uint32 &)
 
virtual void ModifyPeriodicDamageAurasTick (Unit *, Unit *, uint32 &)
 
virtual void ModifyMeleeDamage (Unit *, Unit *, uint32 &)
 
virtual void ModifySpellDamageTaken (Unit *, Unit *, int32 &)
 
- Public Member Functions inherited from ScriptObject
const std::string & GetName () const
 
- Public Member Functions inherited from UpdatableScript< Creature >
virtual void OnUpdate (Creature *, uint32)
 

Private Member Functions

bool CanBuild (Creature *creature)
 

Additional Inherited Members

- Protected Member Functions inherited from CreatureScript
 CreatureScript (const char *name)
 
- Protected Member Functions inherited from UnitScript
 UnitScript (const char *name, bool addToScripts=true)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()
 
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()
 
virtual ~UpdatableScript ()
 

Constructor & Destructor Documentation

npc_wg_demolisher_engineer::npc_wg_demolisher_engineer ( )
inline
117 : CreatureScript("npc_wg_demolisher_engineer") { }
CreatureScript(const char *name)
Definition: ScriptMgr.cpp:1586

Member Function Documentation

bool npc_wg_demolisher_engineer::CanBuild ( Creature creature)
inlineprivate
168  {
169  Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
170  if (!wintergrasp)
171  return false;
172 
173  switch (creature->GetEntry())
174  {
175  case NPC_GOBLIN_MECHANIC:
179  default:
180  return false;
181  }
182  }
virtual uint32 GetData(uint32 dataId) const override
Definition: Battlefield.h:266
Definition: zone_wintergrasp.cpp:65
Definition: BattlefieldWG.h:94
Definition: Battlefield.h:196
#define sBattlefieldMgr
Definition: BattlefieldMgr.h:67
Definition: BattlefieldWG.h:93
Definition: Battlefield.h:33
Definition: zone_wintergrasp.cpp:66
Definition: BattlefieldWG.h:92
uint32 GetEntry() const
Definition: Object.h:107
Definition: BattlefieldWG.h:95

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool npc_wg_demolisher_engineer::OnGossipHello ( Player player,
Creature creature 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

120  {
121  if (creature->IsQuestGiver())
122  player->PrepareQuestMenu(creature->GetGUID());
123 
124  if (CanBuild(creature))
125  {
126  if (player->HasAura(SPELL_CORPORAL))
128  else if (player->HasAura(SPELL_LIEUTENANT))
129  {
133  }
134  }
135  else
137 
138  player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
139  return true;
140  }
#define GOSSIP_HELLO_DEMO2
Definition: zone_wintergrasp.cpp:32
#define GOSSIP_HELLO_DEMO4
Definition: zone_wintergrasp.cpp:34
bool CanBuild(Creature *creature)
Definition: zone_wintergrasp.cpp:167
Definition: ScriptedGossip.h:71
Definition: BattlefieldWG.h:46
Definition: BattlefieldWG.h:47
bool IsQuestGiver() const
Definition: Unit.h:1566
#define GOSSIP_HELLO_DEMO3
Definition: zone_wintergrasp.cpp:33
Definition: ScriptedGossip.h:73
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: GossipDef.h:59
#define GOSSIP_HELLO_DEMO1
Definition: zone_wintergrasp.cpp:31

+ Here is the call graph for this function:

bool npc_wg_demolisher_engineer::OnGossipSelect ( Player player,
Creature creature,
uint32  ,
uint32  action 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

143  {
144  player->CLOSE_GOSSIP_MENU();
145 
146  if (CanBuild(creature))
147  {
148  switch (action - GOSSIP_ACTION_INFO_DEF)
149  {
150  case 0:
151  creature->CastSpell(player, SPELL_BUILD_CATAPULT_FORCE, true);
152  break;
153  case 1:
154  creature->CastSpell(player, SPELL_BUILD_DEMOLISHER_FORCE, true);
155  break;
156  case 2:
158  break;
159  }
160  if (Creature* controlArms = creature->FindNearestCreature(NPC_WINTERGRASP_CONTROL_ARMS, 30.0f, true))
161  creature->CastSpell(controlArms, SPELL_ACTIVATE_CONTROL_ARMS, true);
162  }
163  return true;
164  }
bool CanBuild(Creature *creature)
Definition: zone_wintergrasp.cpp:167
Definition: ScriptedGossip.h:71
Definition: zone_wintergrasp.cpp:50
Definition: zone_wintergrasp.cpp:51
Definition: Creature.h:467
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2443
Definition: zone_wintergrasp.cpp:54
Definition: zone_wintergrasp.cpp:53
Definition: SharedDefines.h:992
Definition: zone_wintergrasp.cpp:52
Definition: zone_wintergrasp.cpp:68
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: