Last active
August 29, 2015 14:00
-
-
Save krofna/7e2c83463cdabb619676 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/server/game/Entities/Creature/GossipDef.h b/src/server/game/Entities/Creature/GossipDef.h | |
index 6c5f465..139ffd4 100755 | |
--- a/src/server/game/Entities/Creature/GossipDef.h | |
+++ b/src/server/game/Entities/Creature/GossipDef.h | |
@@ -277,6 +277,14 @@ class PlayerMenu | |
void SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, bool enableNext) const; | |
void SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, bool canComplete, bool closeOnCancel) const; | |
+ void hack_SendQuestGiverQuestList(std::vector<uint32> Entries, uint64 guid) | |
+ { | |
+ hack_QuestNpcs = Entries; | |
+ hack_guid = guid; | |
+ } | |
+ | |
+ std::vector<uint32> hack_QuestNpcs; | |
+ uint64 hack_guid; | |
private: | |
GossipMenu _gossipMenu; | |
QuestMenu _questMenu; | |
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp | |
index 2f3c410..e51e5b6 100755 | |
--- a/src/server/game/Entities/Player/Player.cpp | |
+++ b/src/server/game/Entities/Player/Player.cpp | |
@@ -14798,6 +14798,50 @@ void Player::PrepareQuestMenu(uint64 guid) | |
else if (GetQuestStatus(quest_id) == QUEST_STATUS_NONE) | |
qm.AddMenuItem(quest_id, 2); | |
} | |
+ if (guid == PlayerTalkClass->hack_guid) | |
+ hack_PrepareQuestMenu(PlayerTalkClass->hack_QuestNpcs); | |
+} | |
+ | |
+void Player::hack_PrepareQuestMenu(std::vector<uint32> Entries) | |
+{ | |
+ QuestRelationBounds objectQR; | |
+ QuestRelationBounds objectQIR; | |
+ | |
+ for (int i = 0; i < Entries.size(); ++i) | |
+ { | |
+ objectQR = sObjectMgr->GetCreatureQuestRelationBounds(Entries[i]); | |
+ objectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(Entries[i]); | |
+ | |
+ QuestMenu &qm = PlayerTalkClass->GetQuestMenu(); | |
+ | |
+ for (QuestRelations::const_iterator i = objectQIR.first; i != objectQIR.second; ++i) | |
+ { | |
+ uint32 quest_id = i->second; | |
+ QuestStatus status = GetQuestStatus(quest_id); | |
+ if (status == QUEST_STATUS_COMPLETE) | |
+ qm.AddMenuItem(quest_id, 4); | |
+ else if (status == QUEST_STATUS_INCOMPLETE) | |
+ qm.AddMenuItem(quest_id, 4); | |
+ //else if (status == QUEST_STATUS_AVAILABLE) | |
+ // qm.AddMenuItem(quest_id, 2); | |
+ } | |
+ | |
+ for (QuestRelations::const_iterator i = objectQR.first; i != objectQR.second; ++i) | |
+ { | |
+ uint32 quest_id = i->second; | |
+ Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id); | |
+ if (!quest) | |
+ continue; | |
+ | |
+ if (!CanTakeQuest(quest, false)) | |
+ continue; | |
+ | |
+ if (quest->IsAutoComplete()) | |
+ qm.AddMenuItem(quest_id, 4); | |
+ else if (GetQuestStatus(quest_id) == QUEST_STATUS_NONE) | |
+ qm.AddMenuItem(quest_id, 2); | |
+ } | |
+ } | |
} | |
void Player::SendPreparedQuest(uint64 guid) | |
@@ -26742,4 +26786,4 @@ void Player::SetInArenaTeam(uint32 ArenaTeamId, uint8 slot, uint8 type) | |
void Player::SetArenaTeamInfoField(uint8 slot, ArenaTeamInfoType type, uint32 value) | |
{ | |
SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + type, value); | |
-} | |
\ No newline at end of file | |
+} | |
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h | |
index 3bdc88d..c448368 100755 | |
--- a/src/server/game/Entities/Player/Player.h | |
+++ b/src/server/game/Entities/Player/Player.h | |
@@ -1456,6 +1456,8 @@ class Player : public Unit, public GridObject<Player> | |
int32 GetQuestLevel(Quest const* quest) const { return quest && (quest->GetQuestLevel() > 0) ? quest->GetQuestLevel() : getLevel(); } | |
+ void hack_PrepareQuestMenu(std::vector<uint32> Entries); | |
+ | |
void PrepareQuestMenu(uint64 guid); | |
void SendPreparedQuest(uint64 guid); | |
bool IsActiveQuest(uint32 quest_id) const; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment