From 0dba3b91225ea92adc4f3358b8ab4c0182699639 Mon Sep 17 00:00:00 2001 From: NoFantasy Date: Tue, 2 Jun 2009 14:42:43 +0400 Subject: [PATCH] [7945] Implement support quest data for DetailsEmoteDelay and OfferRewardEmoteDelay value for set time ordering details and reward emotes. Signed-off-by: VladimirMangos --- sql/mangos.sql | 10 +++++++++- sql/updates/7945_01_mangos_quest_template.sql | 11 +++++++++++ sql/updates/Makefile.am | 2 ++ src/game/GossipDef.cpp | 10 +++++----- src/game/ObjectMgr.cpp | 10 +++++++--- src/game/QuestDef.cpp | 16 +++++++++++----- src/game/QuestDef.h | 2 ++ src/shared/revision_nr.h | 2 +- 8 files changed, 48 insertions(+), 15 deletions(-) create mode 100644 sql/updates/7945_01_mangos_quest_template.sql diff --git a/sql/mangos.sql b/sql/mangos.sql index 61f7971aa..e7be4b4c6 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`; CREATE TABLE `db_version` ( `version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL, - `required_7908_03_mangos_creature_template_addon` bit(1) default NULL + `required_7945_01_mangos_quest_template` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -13264,12 +13264,20 @@ CREATE TABLE `quest_template` ( `DetailsEmote2` smallint(5) unsigned NOT NULL default '0', `DetailsEmote3` smallint(5) unsigned NOT NULL default '0', `DetailsEmote4` smallint(5) unsigned NOT NULL default '0', + `DetailsEmoteDelay1` int(11) unsigned NOT NULL default '0', + `DetailsEmoteDelay2` int(11) unsigned NOT NULL default '0', + `DetailsEmoteDelay3` int(11) unsigned NOT NULL default '0', + `DetailsEmoteDelay4` int(11) unsigned NOT NULL default '0', `IncompleteEmote` smallint(5) unsigned NOT NULL default '0', `CompleteEmote` smallint(5) unsigned NOT NULL default '0', `OfferRewardEmote1` smallint(5) unsigned NOT NULL default '0', `OfferRewardEmote2` smallint(5) unsigned NOT NULL default '0', `OfferRewardEmote3` smallint(5) unsigned NOT NULL default '0', `OfferRewardEmote4` smallint(5) unsigned NOT NULL default '0', + `OfferRewardEmoteDelay1` int(11) unsigned NOT NULL default '0', + `OfferRewardEmoteDelay2` int(11) unsigned NOT NULL default '0', + `OfferRewardEmoteDelay3` int(11) unsigned NOT NULL default '0', + `OfferRewardEmoteDelay4` int(11) unsigned NOT NULL default '0', `StartScript` mediumint(8) unsigned NOT NULL default '0', `CompleteScript` mediumint(8) unsigned NOT NULL default '0', PRIMARY KEY (`entry`) diff --git a/sql/updates/7945_01_mangos_quest_template.sql b/sql/updates/7945_01_mangos_quest_template.sql new file mode 100644 index 000000000..2c4b9a301 --- /dev/null +++ b/sql/updates/7945_01_mangos_quest_template.sql @@ -0,0 +1,11 @@ +ALTER TABLE db_version CHANGE COLUMN required_7908_03_mangos_creature_template_addon required_7945_01_mangos_quest_template bit; + +ALTER TABLE quest_template + ADD COLUMN `DetailsEmoteDelay1` int(11) unsigned NOT NULL default '0' AFTER `DetailsEmote4`, + ADD COLUMN `DetailsEmoteDelay2` int(11) unsigned NOT NULL default '0' AFTER `DetailsEmoteDelay1`, + ADD COLUMN `DetailsEmoteDelay3` int(11) unsigned NOT NULL default '0' AFTER `DetailsEmoteDelay2`, + ADD COLUMN `DetailsEmoteDelay4` int(11) unsigned NOT NULL default '0' AFTER `DetailsEmoteDelay3`, + ADD COLUMN `OfferRewardEmoteDelay1` int(11) unsigned NOT NULL default '0' AFTER `OfferRewardEmote4`, + ADD COLUMN `OfferRewardEmoteDelay2` int(11) unsigned NOT NULL default '0' AFTER `OfferRewardEmoteDelay1`, + ADD COLUMN `OfferRewardEmoteDelay3` int(11) unsigned NOT NULL default '0' AFTER `OfferRewardEmoteDelay2`, + ADD COLUMN `OfferRewardEmoteDelay4` int(11) unsigned NOT NULL default '0' AFTER `OfferRewardEmoteDelay3`; diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 091071864..f8f1332a6 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -210,6 +210,7 @@ pkgdata_DATA = \ 7908_03_mangos_creature_template_addon.sql \ 7932_01_characters_character_pet.sql \ 7938_01_realmd_account.sql \ + 7945_01_mangos_quest_template.sql \ README ## Additional files to include when running 'make dist' @@ -400,4 +401,5 @@ EXTRA_DIST = \ 7908_03_mangos_creature_template_addon.sql \ 7932_01_characters_character_pet.sql \ 7938_01_realmd_account.sql \ + 7945_01_mangos_quest_template.sql \ README diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp index a27a053e3..0576bad2b 100644 --- a/src/game/GossipDef.cpp +++ b/src/game/GossipDef.cpp @@ -503,7 +503,7 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID for (uint32 i=0; i < QUEST_EMOTE_COUNT; ++i) { data << uint32(pQuest->DetailsEmote[i]); - data << uint32(0); // DetailsEmoteDelay + data << uint32(pQuest->DetailsEmoteDelay[i]); // DetailsEmoteDelay (in ms) } pSession->SendPacket( &data ); @@ -641,7 +641,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest ) sLog.outDebug( "WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", pQuest->GetQuestId() ); } -void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID, bool EnbleNext ) +void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID, bool EnableNext ) { std::string Title = pQuest->GetTitle(); std::string OfferRewardText = pQuest->GetOfferRewardText(); @@ -666,7 +666,7 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID, data << Title; data << OfferRewardText; - data << uint32( EnbleNext ); + data << uint32( EnableNext ); data << uint32(0); // unk uint32 EmoteCount = 0; @@ -680,8 +680,8 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID, data << EmoteCount; // Emote Count for (uint32 i = 0; i < EmoteCount; ++i) { - data << uint32(0); // Delay Emote - data << pQuest->OfferRewardEmote[i]; + data << uint32(pQuest->OfferRewardEmoteDelay[i]); // Delay Emote + data << uint32(pQuest->OfferRewardEmote[i]); } ItemPrototype const *pItem; diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index d6e2c7bcc..0f1fbdb04 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -2850,9 +2850,13 @@ void ObjectMgr::LoadQuests() "RewRepFaction1, RewRepFaction2, RewRepFaction3, RewRepFaction4, RewRepFaction5, RewRepValue1, RewRepValue2, RewRepValue3, RewRepValue4, RewRepValue5," // 97 98 99 100 101 102 103 104 105 106 107 "RewHonorableKills, RewOrReqMoney, RewMoneyMaxLevel, RewSpell, RewSpellCast, RewMailTemplateId, RewMailDelaySecs, PointMapId, PointX, PointY, PointOpt," - // 108 109 110 111 112 113 114 115 116 117 - "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4," - // 118 119 + // 108 109 110 111 112 113 114 115 + "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4," + // 116 117 118 119 120 121 + "IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4," + // 122 123 124 125 + "OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4," + // 126 127 "StartScript, CompleteScript" " FROM quest_template"); if(result == NULL) diff --git a/src/game/QuestDef.cpp b/src/game/QuestDef.cpp index 2f0ed421c..8c71d83ac 100644 --- a/src/game/QuestDef.cpp +++ b/src/game/QuestDef.cpp @@ -115,14 +115,20 @@ Quest::Quest(Field * questRecord) for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) DetailsEmote[i] = questRecord[108+i].GetUInt32(); - IncompleteEmote = questRecord[112].GetUInt32(); - CompleteEmote = questRecord[113].GetUInt32(); + for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) + DetailsEmoteDelay[i] = questRecord[112+i].GetUInt32(); + + IncompleteEmote = questRecord[116].GetUInt32(); + CompleteEmote = questRecord[117].GetUInt32(); + + for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) + OfferRewardEmote[i] = questRecord[118+i].GetInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - OfferRewardEmote[i] = questRecord[114+i].GetInt32(); + OfferRewardEmoteDelay[i] = questRecord[122+i].GetInt32(); - QuestStartScript = questRecord[118].GetUInt32(); - QuestCompleteScript = questRecord[119].GetUInt32(); + QuestStartScript = questRecord[126].GetUInt32(); + QuestCompleteScript = questRecord[127].GetUInt32(); QuestFlags |= SpecialFlags << 16; diff --git a/src/game/QuestDef.h b/src/game/QuestDef.h index ae48ba5bd..a22c535b9 100644 --- a/src/game/QuestDef.h +++ b/src/game/QuestDef.h @@ -239,7 +239,9 @@ class Quest uint32 RewRepFaction[QUEST_REPUTATIONS_COUNT]; int32 RewRepValue[QUEST_REPUTATIONS_COUNT]; uint32 DetailsEmote[QUEST_EMOTE_COUNT]; + uint32 DetailsEmoteDelay[QUEST_EMOTE_COUNT]; uint32 OfferRewardEmote[QUEST_EMOTE_COUNT]; + uint32 OfferRewardEmoteDelay[QUEST_EMOTE_COUNT]; uint32 GetReqItemsCount() const { return m_reqitemscount; } uint32 GetReqCreatureOrGOcount() const { return m_reqCreatureOrGOcount; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 48371bd40..53a5aafb6 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7944" + #define REVISION_NR "7945" #endif // __REVISION_NR_H__ -- 2.11.4.GIT