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

Public Member Functions

 npc_wg_quest_giver ()
 
bool OnGossipHello (Player *player, Creature *creature) override
 
uint32 GetDialogStatus (Player *player, Creature *creature) override
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 action) 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
 
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_wg_quest_giver()

npc_wg_quest_giver::npc_wg_quest_giver ( )
inline
407: CreatureScript("npc_wg_quest_giver") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetDialogStatus()

uint32 npc_wg_quest_giver::GetDialogStatus ( Player player,
Creature creature 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

596 {
597 QuestRelationBounds qr = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry());
598 QuestRelationBounds qir = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(creature->GetEntry());
600
601 Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
602
603 for (QuestRelations::const_iterator i = qir.first; i != qir.second; ++i)
604 {
606 uint32 questId = i->second;
607 Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
608 if (!quest)
609 continue;
610
611 ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_AVAILABLE, quest->GetQuestId());
612 if (!sConditionMgr->IsObjectMeetToConditions(player, conditions))
613 continue;
614
615 QuestStatus status = player->GetQuestStatus(questId);
616 if ((status == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(questId)) ||
617 (quest->IsAutoComplete() && player->CanTakeQuest(quest, false)))
618 {
619 if (quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly())
620 result2 = DIALOG_STATUS_REWARD_REP;
621 else
622 result2 = DIALOG_STATUS_REWARD;
623 }
624 else if (status == QUEST_STATUS_INCOMPLETE)
625 result2 = DIALOG_STATUS_INCOMPLETE;
626
627 if (result2 > result)
628 result = result2;
629 }
630
631 for (QuestRelations::const_iterator i = qr.first; i != qr.second; ++i)
632 {
634 uint32 questId = i->second;
635 Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
636 if (!quest)
637 continue;
638
639 ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_AVAILABLE, quest->GetQuestId());
640 if (!sConditionMgr->IsObjectMeetToConditions(player, conditions))
641 continue;
642
643 switch (questId)
644 {
646 if (!sPoolMgr->IsSpawnedObject<Quest>(QUEST_BONES_AND_ARROWS_ALLIANCE_DEF))
647 continue;
648 break;
651 continue;
652 break;
654 if (!sPoolMgr->IsSpawnedObject<Quest>(QUEST_A_RARE_HERB_ALLIANCE_DEF))
655 continue;
656 break;
659 continue;
660 break;
662 if (!sPoolMgr->IsSpawnedObject<Quest>(QUEST_BONES_AND_ARROWS_HORDE_DEF))
663 continue;
664 break;
666 if (!sPoolMgr->IsSpawnedObject<Quest>(QUEST_WARDING_THE_WALLS_HORDE_DEF))
667 continue;
668 break;
671 continue;
672 break;
674 if (!sPoolMgr->IsSpawnedObject<Quest>(QUEST_HEALING_WITH_ROSES_HORDE_DEF))
675 continue;
676 break;
677 }
678
679 if (wintergrasp)
680 {
681 // Certain quests are only available when attacking / defending
682 bool hasCorrectZoneControl = false;
683 switch (questId)
684 {
685 // Horde attacker
692 if (wintergrasp->GetAttackerTeam() == TEAM_HORDE)
693 {
694 hasCorrectZoneControl = true;
695 }
696 break;
697 // Horde defender
705 if (wintergrasp->GetDefenderTeam() == TEAM_HORDE)
706 {
707 hasCorrectZoneControl = true;
708 }
709 break;
710 // Alliance attacker
717 if (wintergrasp->GetAttackerTeam() == TEAM_ALLIANCE)
718 {
719 hasCorrectZoneControl = true;
720 }
721 break;
722 // Alliance defender
730 if (wintergrasp->GetDefenderTeam() == TEAM_ALLIANCE)
731 {
732 hasCorrectZoneControl = true;
733 }
734 break;
735 default:
736 hasCorrectZoneControl = true;
737 break;
738 }
739
740 if (!hasCorrectZoneControl)
741 {
742 continue;
743 }
744 }
745
746 QuestStatus status = player->GetQuestStatus(questId);
747 if (status == QUEST_STATUS_NONE)
748 {
749 if (player->CanSeeStartQuest(quest))
750 {
751 if (player->SatisfyQuestLevel(quest, false))
752 {
753 if (quest->IsAutoComplete())
754 result2 = DIALOG_STATUS_REWARD_REP;
755 else if (player->GetLevel() <= (player->GetQuestLevel(quest) + sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF)))
756 {
757 if (quest->IsDaily())
759 else
760 result2 = DIALOG_STATUS_AVAILABLE;
761 }
762 else
764 }
765 else
767 }
768 }
769
770 if (result2 > result)
771 result = result2;
772 }
773
774 return result;
775 }
std::uint32_t uint32
Definition: Define.h:107
@ QUEST_HEALING_WITH_ROSES_HORDE_DEF
Definition: zone_wintergrasp.cpp:96
@ QUEST_DEFEND_THE_SIEGE_HORDE_ATT
Definition: zone_wintergrasp.cpp:90
@ QUEST_SHOUTHERN_SABOTAGE_ALLIANCE_DEF
Definition: zone_wintergrasp.cpp:110
@ QUEST_SLAY_THEM_ALL_HORDE_DEF
Definition: zone_wintergrasp.cpp:94
@ QUEST_FUELING_THE_DEMOLISHERS_HORDE_DEF
Definition: zone_wintergrasp.cpp:95
@ QUEST_A_RARE_HERB_ALLIANCE_DEF
Definition: zone_wintergrasp.cpp:112
@ QUEST_FUELING_THE_DEMOLISHERS_HORDE_ATT
Definition: zone_wintergrasp.cpp:88
@ QUEST_SLAY_THEM_ALL_HORDE_ATT
Definition: zone_wintergrasp.cpp:87
@ QUEST_STOP_THE_SIEGE_HORDE_DEF
Definition: zone_wintergrasp.cpp:98
@ QUEST_WARDING_THE_WALLS_HORDE_DEF
Definition: zone_wintergrasp.cpp:93
@ QUEST_BONES_AND_ARROWS_ALLIANCE_DEF
Definition: zone_wintergrasp.cpp:107
@ QUEST_A_RARE_HERB_ALLIANCE_ATT
Definition: zone_wintergrasp.cpp:104
@ QUEST_HEALING_WITH_ROSES_HORDE_ATT
Definition: zone_wintergrasp.cpp:89
@ QUEST_BONES_AND_ARROWS_ALLIANCE_ATT
Definition: zone_wintergrasp.cpp:100
@ QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_ATT
Definition: zone_wintergrasp.cpp:102
@ QUEST_FUELING_THE_DEMOLISHERS_ALLIANCE_ATT
Definition: zone_wintergrasp.cpp:105
@ QUEST_STOP_THE_SIEGE_ALLIANCE_DEF
Definition: zone_wintergrasp.cpp:111
@ QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_DEF
Definition: zone_wintergrasp.cpp:109
@ QUEST_WARDING_THE_WARRIORS_ALLIANCE_ATT
Definition: zone_wintergrasp.cpp:101
@ QUEST_TOPPLING_THE_TOWERS_HORDE_DEF
Definition: zone_wintergrasp.cpp:97
@ QUEST_BONES_AND_ARROWS_HORDE_DEF
Definition: zone_wintergrasp.cpp:92
@ QUEST_WARDING_THE_WARRIORS_ALLIANCE_DEF
Definition: zone_wintergrasp.cpp:108
@ QUEST_FUELING_THE_DEMOLISHERS_ALLIANCE_DEF
Definition: zone_wintergrasp.cpp:113
@ QUEST_BONES_AND_ARROWS_HORDE_ATT
Definition: zone_wintergrasp.cpp:85
@ QUEST_DEFEND_THE_SIEGE_ALLIANCE_ATT
Definition: zone_wintergrasp.cpp:103
@ QUEST_JINXING_THE_WALLS_HORDE_ATT
Definition: zone_wintergrasp.cpp:86
@ TEAM_ALLIANCE
Definition: SharedDefines.h:760
@ TEAM_HORDE
Definition: SharedDefines.h:761
@ BATTLEFIELD_BATTLEID_WG
Definition: Battlefield.h:35
#define sBattlefieldMgr
Definition: BattlefieldMgr.h:77
std::pair< QuestRelations::const_iterator, QuestRelations::const_iterator > QuestRelationBounds
Definition: ObjectMgr.h:525
#define sObjectMgr
Definition: ObjectMgr.h:1635
QuestGiverStatus
Definition: QuestDef.h:111
@ DIALOG_STATUS_UNAVAILABLE
Definition: QuestDef.h:113
@ DIALOG_STATUS_NONE
Definition: QuestDef.h:112
@ DIALOG_STATUS_AVAILABLE
Definition: QuestDef.h:120
@ DIALOG_STATUS_REWARD
Definition: QuestDef.h:122
@ DIALOG_STATUS_LOW_LEVEL_AVAILABLE
Definition: QuestDef.h:114
@ DIALOG_STATUS_REWARD_REP
Definition: QuestDef.h:118
@ DIALOG_STATUS_INCOMPLETE
Definition: QuestDef.h:117
@ DIALOG_STATUS_AVAILABLE_REP
Definition: QuestDef.h:119
QuestStatus
Definition: QuestDef.h:99
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:103
@ QUEST_STATUS_NONE
Definition: QuestDef.h:100
@ QUEST_STATUS_COMPLETE
Definition: QuestDef.h:101
@ CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF
Definition: IWorld.h:287
#define sPoolMgr
Definition: PoolMgr.h:163
#define sConditionMgr
Definition: ConditionMgr.h:290
@ CONDITION_SOURCE_TYPE_QUEST_AVAILABLE
Definition: ConditionMgr.h:142
std::list< Condition * > ConditionList
Definition: ConditionMgr.h:237
#define sWorld
Definition: World.h:443
Definition: Battlefield.h:204
TeamId GetDefenderTeam()
Definition: Battlefield.h:275
TeamId GetAttackerTeam()
Definition: Battlefield.h:276
uint32 GetEntry() const
Definition: Object.h:115
int32 GetQuestLevel(Quest const *quest) const
Definition: Player.h:1434
bool GetQuestRewardStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1414
bool CanTakeQuest(Quest const *quest, bool msg)
Definition: PlayerQuest.cpp:251
bool CanSeeStartQuest(Quest const *quest)
Definition: PlayerQuest.cpp:237
bool SatisfyQuestLevel(Quest const *qInfo, bool msg) const
Definition: PlayerQuest.cpp:966
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1429
uint8 GetLevel() const
Definition: Unit.h:1024
Definition: QuestDef.h:210
bool IsRepeatable() const
Definition: QuestDef.h:283
bool IsAutoComplete() const
Definition: QuestDef.cpp:274
uint32 GetQuestId() const
Definition: QuestDef.h:228
bool IsDaily() const
Definition: QuestDef.h:287
bool IsDailyOrWeekly() const
Definition: QuestDef.h:291

References BATTLEFIELD_BATTLEID_WG, Player::CanSeeStartQuest(), Player::CanTakeQuest(), CONDITION_SOURCE_TYPE_QUEST_AVAILABLE, CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF, DIALOG_STATUS_AVAILABLE, DIALOG_STATUS_AVAILABLE_REP, DIALOG_STATUS_INCOMPLETE, DIALOG_STATUS_LOW_LEVEL_AVAILABLE, DIALOG_STATUS_NONE, DIALOG_STATUS_REWARD, DIALOG_STATUS_REWARD_REP, DIALOG_STATUS_UNAVAILABLE, Battlefield::GetAttackerTeam(), Battlefield::GetDefenderTeam(), Object::GetEntry(), Unit::GetLevel(), Quest::GetQuestId(), Player::GetQuestLevel(), Player::GetQuestRewardStatus(), Player::GetQuestStatus(), Quest::IsAutoComplete(), Quest::IsDaily(), Quest::IsDailyOrWeekly(), Quest::IsRepeatable(), QUEST_A_RARE_HERB_ALLIANCE_ATT, QUEST_A_RARE_HERB_ALLIANCE_DEF, QUEST_BONES_AND_ARROWS_ALLIANCE_ATT, QUEST_BONES_AND_ARROWS_ALLIANCE_DEF, QUEST_BONES_AND_ARROWS_HORDE_ATT, QUEST_BONES_AND_ARROWS_HORDE_DEF, QUEST_DEFEND_THE_SIEGE_ALLIANCE_ATT, QUEST_DEFEND_THE_SIEGE_HORDE_ATT, QUEST_FUELING_THE_DEMOLISHERS_ALLIANCE_ATT, QUEST_FUELING_THE_DEMOLISHERS_ALLIANCE_DEF, QUEST_FUELING_THE_DEMOLISHERS_HORDE_ATT, QUEST_FUELING_THE_DEMOLISHERS_HORDE_DEF, QUEST_HEALING_WITH_ROSES_HORDE_ATT, QUEST_HEALING_WITH_ROSES_HORDE_DEF, QUEST_JINXING_THE_WALLS_HORDE_ATT, QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_ATT, QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_DEF, QUEST_SHOUTHERN_SABOTAGE_ALLIANCE_DEF, QUEST_SLAY_THEM_ALL_HORDE_ATT, QUEST_SLAY_THEM_ALL_HORDE_DEF, QUEST_STATUS_COMPLETE, QUEST_STATUS_INCOMPLETE, QUEST_STATUS_NONE, QUEST_STOP_THE_SIEGE_ALLIANCE_DEF, QUEST_STOP_THE_SIEGE_HORDE_DEF, QUEST_TOPPLING_THE_TOWERS_HORDE_DEF, QUEST_WARDING_THE_WALLS_HORDE_DEF, QUEST_WARDING_THE_WARRIORS_ALLIANCE_ATT, QUEST_WARDING_THE_WARRIORS_ALLIANCE_DEF, Player::SatisfyQuestLevel(), sBattlefieldMgr, sConditionMgr, sObjectMgr, sPoolMgr, sWorld, TEAM_ALLIANCE, and TEAM_HORDE.

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

410 {
411 if (creature->IsQuestGiver())
412 {
413 player->PrepareQuestMenu(creature->GetGUID());
414 }
415
416 if (creature->IsVendor())
417 {
419 }
420
421 Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
422 if (!wintergrasp)
423 {
424 return true;
425 }
426
427 if (creature->IsQuestGiver())
428 {
429 QuestRelationBounds objectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry());
430 QuestRelationBounds objectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(creature->GetEntry());
431
432 QuestMenu& qm = player->PlayerTalkClass->GetQuestMenu();
433 qm.ClearMenu();
434
435 for (QuestRelations::const_iterator i = objectQIR.first; i != objectQIR.second; ++i)
436 {
437 uint32 quest_id = i->second;
438 QuestStatus status = player->GetQuestStatus(quest_id);
439 if (status == QUEST_STATUS_COMPLETE)
440 qm.AddMenuItem(quest_id, 4);
441 else if (status == QUEST_STATUS_INCOMPLETE)
442 qm.AddMenuItem(quest_id, 4);
443 //else if (status == QUEST_STATUS_AVAILABLE)
444 // qm.AddMenuItem(quest_id, 2);
445 }
446
447 // xinef: add att/def doubles if this quest is spawned
448 std::vector<uint32> questRelationVector;
449 for (QuestRelations::const_iterator i = objectQR.first; i != objectQR.second; ++i)
450 {
451 uint32 questId = i->second;
452 Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
453 if (!quest)
454 continue;
455
456 switch (questId)
457 {
459 if (!sPoolMgr->IsSpawnedObject<Quest>(QUEST_BONES_AND_ARROWS_ALLIANCE_DEF))
460 continue;
461 questRelationVector.push_back(QUEST_BONES_AND_ARROWS_ALLIANCE_ATT);
462 break;
465 continue;
466 questRelationVector.push_back(QUEST_WARDING_THE_WARRIORS_ALLIANCE_ATT);
467 break;
469 if (!sPoolMgr->IsSpawnedObject<Quest>(QUEST_A_RARE_HERB_ALLIANCE_DEF))
470 continue;
471 questRelationVector.push_back(QUEST_A_RARE_HERB_ALLIANCE_ATT);
472 break;
475 continue;
476 questRelationVector.push_back(QUEST_FUELING_THE_DEMOLISHERS_ALLIANCE_ATT);
477 break;
479 if (!sPoolMgr->IsSpawnedObject<Quest>(QUEST_BONES_AND_ARROWS_HORDE_DEF))
480 continue;
481 questRelationVector.push_back(QUEST_BONES_AND_ARROWS_HORDE_ATT);
482 break;
484 if (!sPoolMgr->IsSpawnedObject<Quest>(QUEST_WARDING_THE_WALLS_HORDE_DEF))
485 continue;
486 questRelationVector.push_back(QUEST_JINXING_THE_WALLS_HORDE_ATT);
487 break;
490 continue;
491 questRelationVector.push_back(QUEST_FUELING_THE_DEMOLISHERS_HORDE_ATT);
492 break;
494 if (!sPoolMgr->IsSpawnedObject<Quest>(QUEST_HEALING_WITH_ROSES_HORDE_DEF))
495 continue;
496 questRelationVector.push_back(QUEST_HEALING_WITH_ROSES_HORDE_ATT);
497 break;
498 default:
499 questRelationVector.push_back(questId);
500 break;
501 }
502 }
503
504 for (std::vector<uint32>::const_iterator i = questRelationVector.begin(); i != questRelationVector.end(); ++i)
505 {
506 uint32 questId = *i;
507 Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
508 switch (questId)
509 {
510 // Horde attacker
517 if (wintergrasp->GetAttackerTeam() == TEAM_HORDE)
518 {
519 QuestStatus status = player->GetQuestStatus(questId);
520
521 if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
522 qm.AddMenuItem(questId, 4);
523 else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
524 qm.AddMenuItem(questId, 2);
525 }
526 break;
527 // Horde defender
535 if (wintergrasp->GetDefenderTeam() == TEAM_HORDE)
536 {
537 QuestStatus status = player->GetQuestStatus(questId);
538
539 if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
540 qm.AddMenuItem(questId, 4);
541 else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
542 qm.AddMenuItem(questId, 2);
543 }
544 break;
545 // Alliance attacker
552 if (wintergrasp->GetAttackerTeam() == TEAM_ALLIANCE)
553 {
554 QuestStatus status = player->GetQuestStatus(questId);
555
556 if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
557 qm.AddMenuItem(questId, 4);
558 else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
559 qm.AddMenuItem(questId, 2);
560 }
561 break;
562 // Alliance defender
570 if (wintergrasp->GetDefenderTeam() == TEAM_ALLIANCE)
571 {
572 QuestStatus status = player->GetQuestStatus(questId);
573
574 if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
575 qm.AddMenuItem(questId, 4);
576 else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
577 qm.AddMenuItem(questId, 2);
578 }
579 break;
580 default:
581 QuestStatus status = player->GetQuestStatus(questId);
582
583 if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
584 qm.AddMenuItem(questId, 4);
585 else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
586 qm.AddMenuItem(questId, 2);
587 break;
588 }
589 }
590 }
591 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
592 return true;
593 }
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const guid)
Definition: ScriptedGossip.cpp:45
void AddGossipItemFor(Player *player, uint32 icon, std::string const &text, uint32 sender, uint32 action)
Definition: ScriptedGossip.cpp:28
#define GOSSIP_TEXT_BROWSE_GOODS
Definition: ScriptedGossip.h:25
@ GOSSIP_SENDER_MAIN
Definition: ScriptedGossip.h:70
@ GOSSIP_ACTION_TRADE
Definition: ScriptedGossip.h:56
@ GOSSIP_ICON_VENDOR
Definition: GossipDef.h:62
Definition: GossipDef.h:229
void ClearMenu()
Definition: GossipDef.cpp:310
void AddMenuItem(uint32 QuestId, uint8 Icon)
Definition: GossipDef.cpp:286
QuestMenu & GetQuestMenu()
Definition: GossipDef.h:265
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
void PrepareQuestMenu(ObjectGuid guid)
Definition: PlayerQuest.cpp:39
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:404
PlayerMenu * PlayerTalkClass
Definition: Player.h:2239
bool IsQuestGiver() const
Definition: Unit.h:762
bool IsVendor() const
Definition: Unit.h:760

References AddGossipItemFor(), QuestMenu::AddMenuItem(), BATTLEFIELD_BATTLEID_WG, Player::CanTakeQuest(), QuestMenu::ClearMenu(), Battlefield::GetAttackerTeam(), Battlefield::GetDefenderTeam(), Object::GetEntry(), Player::GetGossipTextId(), Object::GetGUID(), PlayerMenu::GetQuestMenu(), Player::GetQuestStatus(), GOSSIP_ACTION_TRADE, GOSSIP_ICON_VENDOR, GOSSIP_SENDER_MAIN, GOSSIP_TEXT_BROWSE_GOODS, Quest::IsAutoComplete(), Unit::IsQuestGiver(), Unit::IsVendor(), Player::PlayerTalkClass, Player::PrepareQuestMenu(), QUEST_A_RARE_HERB_ALLIANCE_ATT, QUEST_A_RARE_HERB_ALLIANCE_DEF, QUEST_BONES_AND_ARROWS_ALLIANCE_ATT, QUEST_BONES_AND_ARROWS_ALLIANCE_DEF, QUEST_BONES_AND_ARROWS_HORDE_ATT, QUEST_BONES_AND_ARROWS_HORDE_DEF, QUEST_DEFEND_THE_SIEGE_ALLIANCE_ATT, QUEST_DEFEND_THE_SIEGE_HORDE_ATT, QUEST_FUELING_THE_DEMOLISHERS_ALLIANCE_ATT, QUEST_FUELING_THE_DEMOLISHERS_ALLIANCE_DEF, QUEST_FUELING_THE_DEMOLISHERS_HORDE_ATT, QUEST_FUELING_THE_DEMOLISHERS_HORDE_DEF, QUEST_HEALING_WITH_ROSES_HORDE_ATT, QUEST_HEALING_WITH_ROSES_HORDE_DEF, QUEST_JINXING_THE_WALLS_HORDE_ATT, QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_ATT, QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_DEF, QUEST_SHOUTHERN_SABOTAGE_ALLIANCE_DEF, QUEST_SLAY_THEM_ALL_HORDE_ATT, QUEST_SLAY_THEM_ALL_HORDE_DEF, QUEST_STATUS_COMPLETE, QUEST_STATUS_INCOMPLETE, QUEST_STATUS_NONE, QUEST_STOP_THE_SIEGE_ALLIANCE_DEF, QUEST_STOP_THE_SIEGE_HORDE_DEF, QUEST_TOPPLING_THE_TOWERS_HORDE_DEF, QUEST_WARDING_THE_WALLS_HORDE_DEF, QUEST_WARDING_THE_WARRIORS_ALLIANCE_ATT, QUEST_WARDING_THE_WARRIORS_ALLIANCE_DEF, sBattlefieldMgr, SendGossipMenuFor(), sObjectMgr, sPoolMgr, TEAM_ALLIANCE, and TEAM_HORDE.

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

778 {
779 ClearGossipMenuFor(player);
780 switch (action)
781 {
783 player->GetSession()->SendListInventory(creature->GetGUID());
784 break;
785 }
786
787 return true;
788 }
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
WorldSession * GetSession() const
Definition: Player.h:1998
void SendListInventory(ObjectGuid guid, uint32 vendorEntry=0)
Definition: ItemHandler.cpp:1035

References ClearGossipMenuFor(), Object::GetGUID(), Player::GetSession(), GOSSIP_ACTION_TRADE, and WorldSession::SendListInventory().