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

Public Member Functions

 npc_cos_chromie_start ()
 
bool OnQuestAccept (Player *, Creature *creature, const Quest *pQuest)
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32)
 
- 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
 
uint16 GetTotalAvailableHooks ()
 
- 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, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_cos_chromie_start()

npc_cos_chromie_start::npc_cos_chromie_start ( )
inline
1415: CreatureScript("npc_cos_chromie_start") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ OnGossipSelect()

bool npc_cos_chromie_start::OnGossipSelect ( Player player,
Creature creature,
uint32  ,
uint32   
)
inlinevirtual

Reimplemented from CreatureScript.

1431 {
1432 // final menu id, show crates if hidden and add item if missing
1433 if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 9595)
1434 {
1435 if (InstanceScript* pInstance = creature->GetInstanceScript())
1436 {
1437 if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
1438 {
1439 pInstance->SetData(DATA_SHOW_CRATES, 1);
1440 }
1441 }
1442
1443 if (!player->HasItemCount(ITEM_ARCANE_DISRUPTOR))
1444 {
1445 creature->CastSpell(player, SPELL_SUMMON_ARCANE_DISRUPTOR);
1446 }
1447 }
1448 // Skip Event
1449 else if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11277)
1450 {
1451 if (InstanceScript* pInstance = creature->GetInstanceScript())
1452 {
1453 if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
1454 {
1456 if (Creature* arthas = ObjectAccessor::GetCreature(*creature, pInstance->GetGuidData(DATA_ARTHAS)))
1457 {
1458 arthas->AI()->Reset();
1459 }
1460 }
1462 }
1463 }
1464
1465 // return false to display last windows
1466 return false;
1467 }
@ ITEM_ARCANE_DISRUPTOR
Definition: culling_of_stratholme.cpp:1406
@ SPELL_SUMMON_ARCANE_DISRUPTOR
Definition: culling_of_stratholme.cpp:1409
@ DATA_ARTHAS
Definition: culling_of_stratholme.h:41
const Position LeaderIntroPos2
Definition: culling_of_stratholme.h:153
@ COS_PROGRESS_NOT_STARTED
Definition: culling_of_stratholme.h:125
@ COS_PROGRESS_FINISHED_INTRO
Definition: culling_of_stratholme.h:128
@ DATA_ARTHAS_EVENT
Definition: culling_of_stratholme.h:28
@ DATA_SHOW_CRATES
Definition: culling_of_stratholme.h:32
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
Definition: Creature.h:43
uint32 GetMenuId() const
Definition: GossipDef.h:172
GossipMenu & GetGossipMenu()
Definition: GossipDef.h:264
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
float GetPositionZ() const
Definition: Position.h:118
float GetOrientation() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:116
float GetPositionY() const
Definition: Position.h:117
bool HasItemCount(uint32 item, uint32 count=1, bool inBankAlso=false) const
Definition: PlayerStorage.cpp:655
PlayerMenu * PlayerTalkClass
Definition: Player.h:2239
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:1167
void NearTeleportTo(Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
Definition: Unit.cpp:19979
Definition: InstanceScript.h:142

References Unit::CastSpell(), COS_PROGRESS_FINISHED_INTRO, COS_PROGRESS_NOT_STARTED, DATA_ARTHAS, DATA_ARTHAS_EVENT, DATA_SHOW_CRATES, ObjectAccessor::GetCreature(), PlayerMenu::GetGossipMenu(), WorldObject::GetInstanceScript(), GossipMenu::GetMenuId(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Player::HasItemCount(), ITEM_ARCANE_DISRUPTOR, LeaderIntroPos2, Unit::NearTeleportTo(), Player::PlayerTalkClass, and SPELL_SUMMON_ARCANE_DISRUPTOR.

◆ OnQuestAccept()

bool npc_cos_chromie_start::OnQuestAccept ( Player ,
Creature creature,
const Quest pQuest 
)
inlinevirtual

Reimplemented from CreatureScript.

1418 {
1419 if (pQuest->GetQuestId() == QUEST_DISPELLING_ILLUSIONS)
1420 {
1421 if (InstanceScript* pInstance = creature->GetInstanceScript())
1422 {
1423 pInstance->SetData(DATA_SHOW_CRATES, 1);
1424 }
1425 }
1426
1427 return true;
1428 }
@ QUEST_DISPELLING_ILLUSIONS
Definition: culling_of_stratholme.cpp:1407
uint32 GetQuestId() const
Definition: QuestDef.h:228

References DATA_SHOW_CRATES, WorldObject::GetInstanceScript(), Quest::GetQuestId(), and QUEST_DISPELLING_ILLUSIONS.