AzeorthCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_natrualist_bite Class Reference
Inheritance diagram for npc_natrualist_bite:
CreatureScript ScriptObject UpdatableScript< Creature >

Classes

struct  npc_natrualist_biteAI
 

Public Member Functions

 npc_natrualist_bite ()
 
bool OnGossipHello (Player *player, Creature *creature) override
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32) override
 
CreatureAIGetAI (Creature *creature) const override
 
- Public Member Functions inherited from CreatureScript
bool IsDatabaseBound () const override
 
virtual bool OnGossipHello (Player *, Creature *)
 
virtual bool OnGossipSelect (Player *, Creature *, uint32, uint32)
 
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 OnQuestComplete (Player *, Creature *, Quest const *)
 
virtual bool OnQuestReward (Player *, Creature *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, Creature *)
 
virtual CreatureAIGetAI (Creature *) const
 
virtual void OnFfaPvpStateUpdate (Creature *, bool)
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
- Public Member Functions inherited from UpdatableScript< Creature >
virtual void OnUpdate (Creature *, uint32)
 

Additional Inherited Members

- Protected Member Functions inherited from CreatureScript
 CreatureScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()=default
 
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_natrualist_bite()

npc_natrualist_bite::npc_natrualist_bite ( )
inline
50: CreatureScript("npc_natrualist_bite") { }
Definition: ScriptMgr.h:718

Member Function Documentation

◆ GetAI()

CreatureAI * npc_natrualist_bite::GetAI ( Creature creature) const
inlineoverridevirtual

Reimplemented from CreatureScript.

120 {
121 return new npc_natrualist_biteAI (creature);
122 }

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

53 {
54 uint32 menuId = creature->AI()->GetData(1) ? 7540 : 7520;
55 player->PrepareGossipMenu(creature, menuId, false);
56 player->SendPreparedGossip(creature);
57 return true;
58 }
std::uint32_t uint32
Definition: Define.h:108
virtual uint32 GetData(uint32) const
Definition: UnitAI.h:197
CreatureAI * AI() const
Definition: Creature.h:134
void SendPreparedGossip(WorldObject *source)
Definition: PlayerGossip.cpp:210
void PrepareGossipMenu(WorldObject *source, uint32 menuId=0, bool showQuests=false)
Definition: PlayerGossip.cpp:31

References Creature::AI(), UnitAI::GetData(), Player::PrepareGossipMenu(), and Player::SendPreparedGossip().

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

61 {
62 ClearGossipMenuFor(player);
63 CloseGossipMenuFor(player);
64 if (creature->AI()->GetData(1))
65 {
66 creature->CastSpell(player, SPELL_MARK_OF_BITE, true);
67 player->KilledMonsterCredit(creature->GetEntry());
68 creature->DespawnOrUnsummon(1000);
69 }
70 else
71 {
72 creature->SetImmuneToAll(false);
73 Creature* cr;
74 if ((cr = creature->SummonCreature(17957, -186, -790, 43.8f, 4.2f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)))
75 cr->AI()->AttackStart(creature);
76 if ((cr = creature->SummonCreature(17960, -188, -783, 43.8f, 4.2f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)))
77 cr->AI()->AttackStart(player);
78 if ((cr = creature->SummonCreature(17957, -196, -783, 43.8f, 4.4f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)))
79 cr->AI()->AttackStart(player);
80 GameObject* cage = creature->FindNearestGameObject(GO_CAGE_ENTRY, 20.0f);
81 if (cage)
83 creature->SetHomePosition(-195.39f, -795.91f, 43.8f, 1.0f);
84 creature->AI()->Talk(1);
85 }
86 return true;
87 }
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
@ GO_STATE_ACTIVE
Definition: GameObject.h:734
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition: Object.h:45
@ GO_CAGE_ENTRY
Definition: zone_zangarmarsh.cpp:44
@ SPELL_MARK_OF_BITE
Definition: zone_zangarmarsh.cpp:43
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:28
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:58
Definition: Creature.h:46
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:320
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Despawn or Unsummon creature. If creature is a TempSummon it will be unsummoned.
Definition: Creature.cpp:2154
Definition: GameObject.h:813
void SetGoState(GOState state)
Definition: GameObject.cpp:2441
uint32 GetEntry() const
Definition: Object.h:109
GameObject * FindNearestGameObject(uint32 entry, float range, bool onlySpawned=false) const
Definition: Object.cpp:2403
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr) const
Definition: Object.cpp:2303
void KilledMonsterCredit(uint32 entry, ObjectGuid guid=ObjectGuid::Empty)
Definition: PlayerQuest.cpp:1904
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1428
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:1714

References Creature::AI(), UnitAI::AttackStart(), Unit::CastSpell(), ClearGossipMenuFor(), CloseGossipMenuFor(), Creature::DespawnOrUnsummon(), WorldObject::FindNearestGameObject(), UnitAI::GetData(), Object::GetEntry(), GO_CAGE_ENTRY, GO_STATE_ACTIVE, Player::KilledMonsterCredit(), GameObject::SetGoState(), Creature::SetHomePosition(), Unit::SetImmuneToAll(), SPELL_MARK_OF_BITE, WorldObject::SummonCreature(), CreatureAI::Talk(), and TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT.