这篇教程C++ AddQuestLevelToTitle函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AddQuestLevelToTitle函数的典型用法代码示例。如果您正苦于以下问题:C++ AddQuestLevelToTitle函数的具体用法?C++ AddQuestLevelToTitle怎么用?C++ AddQuestLevelToTitle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AddQuestLevelToTitle函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: AddQuestLevelToTitlevoid PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUID, bool enableNext) const{ std::string questTitle = quest->GetLogTitle(); std::string questOfferRewardText = quest->GetOfferRewardText(); std::string portraitGiverText = quest->GetPortraitGiverText(); std::string portraitGiverName = quest->GetPortraitGiverName(); std::string portraitTurnInText = quest->GetPortraitTurnInText(); std::string portraitTurnInName = quest->GetPortraitTurnInName(); LocaleConstant locale = _session->GetSessionDbLocaleIndex(); if (locale >= LOCALE_enUS) { if (QuestTemplateLocale const* questTemplateLocale = sObjectMgr->GetQuestLocale(quest->GetQuestId())) { ObjectMgr::GetLocaleString(questTemplateLocale->LogTitle, locale, questTitle); ObjectMgr::GetLocaleString(questTemplateLocale->OfferRewardText, locale, questOfferRewardText); ObjectMgr::GetLocaleString(questTemplateLocale->PortraitGiverText, locale, portraitGiverText); ObjectMgr::GetLocaleString(questTemplateLocale->PortraitGiverName, locale, portraitGiverName); ObjectMgr::GetLocaleString(questTemplateLocale->PortraitTurnInText, locale, portraitTurnInText); ObjectMgr::GetLocaleString(questTemplateLocale->PortraitTurnInName, locale, portraitTurnInName); } } if (sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS)) AddQuestLevelToTitle(questTitle, quest->GetQuestLevel()); WorldPackets::Quest::QuestGiverOfferRewardMessage packet; WorldPackets::Quest::QuestGiverOfferReward& offer = packet.QuestData; quest->BuildQuestRewards(offer.Rewards, _session->GetPlayer()); offer.QuestGiverGUID = npcGUID; // Is there a better way? what about game objects? if (Creature const* creature = ObjectAccessor::GetCreature(*_session->GetPlayer(), npcGUID)) offer.QuestGiverCreatureID = creature->GetCreatureTemplate()->Entry; offer.QuestID = quest->GetQuestId(); offer.AutoLaunched = enableNext; offer.SuggestedPartyMembers = quest->GetSuggestedPlayers(); for (uint32 i = 0; i < QUEST_EMOTE_COUNT && quest->OfferRewardEmote[i]; ++i) offer.Emotes.push_back(WorldPackets::Quest::QuestDescEmote(quest->OfferRewardEmote[i], quest->OfferRewardEmoteDelay[i])); offer.QuestFlags[0] = quest->GetFlags(); offer.QuestFlags[1] = quest->GetFlagsEx(); packet.QuestTitle = questTitle; packet.RewardText = questOfferRewardText; packet.PortraitTurnIn = quest->GetQuestTurnInPortrait(); packet.PortraitGiver = quest->GetQuestGiverPortrait(); packet.PortraitGiverText = portraitGiverText; packet.PortraitGiverName = portraitGiverName; packet.PortraitTurnInText = portraitTurnInText; packet.PortraitTurnInName = portraitTurnInName; packet.QuestPackageID = quest->GetQuestPackageID(); _session->SendPacket(packet.Write()); TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPC=%s, questid=%u", npcGUID.ToString().c_str(), quest->GetQuestId());}
开发者ID:Diyvol,项目名称:TrinityCore,代码行数:59,
示例2: datavoid PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title, uint64 npcGuid){ ObjectGuid guid = npcGuid; uint32 count = 0; WorldPacket data(SMSG_QUESTGIVER_QUEST_LIST, 100); // guess size data << guid; data << int32(eEmote._Emote); data << int32(eEmote._Delay); size_t countPos = data.wpos(); data << uint32(count); // Store this instead of checking the Singleton every loop iteration bool questLevelInTitle = sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS); for (uint32 i = 0; i < _questMenu.GetMenuItemCount(); ++i) { QuestMenuItem const& qmi = _questMenu.GetItem(i); uint32 questID = qmi.QuestId; if (Quest const* quest = sObjectMgr->GetQuestTemplate(questID)) { ++count; std::string title = quest->GetTitle(); int32 locale = _session->GetSessionDbLocaleIndex(); if (locale >= 0) if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(questID)) ObjectMgr::GetLocaleString(localeData->Title, locale, title); if (questLevelInTitle) AddQuestLevelToTitle(title, quest->GetQuestLevel()); data << int32(questID); data << int32(qmi.QuestIcon); data << int32(quest->GetQuestLevel()); data << int32(quest->GetFlags()); data << int32(quest->GetFlags2()); data.WriteBit(quest->IsRepeatable()); data.WriteBits(quest->GetTitle().size(), 9); data.FlushBits(); data.WriteString(quest->GetTitle()); } } data.WriteBits(Title.size(), 11); data.FlushBits(); data.WriteString(Title); data.put<uint32>(countPos, count); _session->SendPacket(&data); TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC Guid=%u", GUID_LOPART(npcGuid));}
开发者ID:Tomoaniki,项目名称:SkyFire_6xx,代码行数:59,
示例3: datavoid PlayerMenu::SendGossipMenu(uint32 titleTextId, uint64 objectGUID){ _gossipMenu.SetSenderGUID(objectGUID); WorldPacket data(SMSG_GOSSIP_MESSAGE, 100); // guess size data << uint64(objectGUID); data << uint32(_gossipMenu.GetMenuId()); // new 2.4.0 data << uint32(titleTextId); data << uint32(_gossipMenu.GetMenuItemCount()); // max count 0x10 for (GossipMenuItemContainer::const_iterator itr = _gossipMenu.GetMenuItems().begin(); itr != _gossipMenu.GetMenuItems().end(); ++itr) { GossipMenuItem const& item = itr->second; data << uint32(itr->first); data << uint8(item.MenuItemIcon); data << uint8(item.IsCoded); // makes pop up box password data << uint32(item.BoxMoney); // money required to open menu, 2.0.3 data << item.Message; // text for gossip item data << item.BoxMessage; // accept text (related to money) pop up box, 2.0.3 } size_t count_pos = data.wpos(); data << uint32(0); // max count 0x20 uint32 count = 0; // Store this instead of checking the Singleton every loop iteration bool questLevelInTitle = sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS); for (uint8 i = 0; i < _questMenu.GetMenuItemCount(); ++i) { QuestMenuItem const& item = _questMenu.GetItem(i); uint32 questID = item.QuestId; if (Quest const* quest = sObjectMgr->GetQuestTemplate(questID)) { ++count; data << uint32(questID); data << uint32(item.QuestIcon); data << int32(quest->GetQuestLevel()); data << uint32(quest->GetFlags()); // 3.3.3 quest flags data << uint8(0); // 3.3.3 changes icon: blue question or yellow exclamation std::string title = quest->GetTitle(); int32 locale = _session->GetSessionDbLocaleIndex(); if (locale >= 0) if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(questID)) ObjectMgr::GetLocaleString(localeData->Title, locale, title); if (questLevelInTitle) AddQuestLevelToTitle(title, quest->GetQuestLevel()); data << title; // max 0x200 } } data.put<uint8>(count_pos, count); _session->SendPacket(&data);}
开发者ID:maxtros,项目名称:ArkCORE-NG,代码行数:57,
示例4: datavoid PlayerMenu::SendGossipMenu(uint32 TitleTextId, uint64 objectGUID){ WorldPacket data(SMSG_GOSSIP_MESSAGE, (100)); // guess size data << uint64(objectGUID); data << uint32(mGossipMenu.GetMenuId()); // new 2.4.0 data << uint32(TitleTextId); data << uint32(mGossipMenu.MenuItemCount()); // max count 0x20 for (uint32 iI = 0; iI < mGossipMenu.MenuItemCount(); ++iI) { GossipMenuItem const& gItem = mGossipMenu.GetItem(iI); data << uint32(iI); data << uint8(gItem.m_gIcon); data << uint8(gItem.m_gCoded); // makes pop up box password data << uint32(gItem.m_gBoxMoney); // money required to open menu, 2.0.3 data << gItem.m_gMessage; // text for gossip item, max 0x800 data << gItem.m_gBoxMessage; // accept text (related to money) pop up box, 2.0.3, max 0x800 } data << uint32(mQuestMenu.MenuItemCount()); // max count 0x20 // Store this instead of checking the Singleton every loop iteration bool questLevelInTitle = sWorld.getConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS); for (uint32 iI = 0; iI < mQuestMenu.MenuItemCount(); ++iI) { QuestMenuItem const& qItem = mQuestMenu.GetItem(iI); uint32 questID = qItem.m_qId; Quest const* pQuest = sObjectMgr.GetQuestTemplate(questID); data << uint32(questID); data << uint32(qItem.m_qIcon); data << int32(pQuest->GetQuestLevel()); std::string Title = pQuest->GetTitle(); int loc_idx = pSession->GetSessionDbLocaleIndex(); if (loc_idx >= 0) if (QuestLocale const* ql = sObjectMgr.GetQuestLocale(questID)) if (ql->Title.size() > uint32(loc_idx) && !ql->Title[loc_idx].empty()) Title = ql->Title[loc_idx]; if (questLevelInTitle) AddQuestLevelToTitle(Title, pQuest->GetQuestLevel()); data << Title; } pSession->SendPacket(&data);}
开发者ID:Phentora,项目名称:OregonCore,代码行数:49,
示例5: datavoid PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title, uint64 npcGUID){ WorldPacket data(SMSG_QUESTGIVER_QUEST_LIST, 100); // guess size data << uint64(npcGUID); data << Title; data << uint32(eEmote._Delay); // player emote data << uint32(eEmote._Emote); // NPC emote size_t count_pos = data.wpos(); data << uint8 (0); uint32 count = 0; // Store this instead of checking the Singleton every loop iteration bool questLevelInTitle = sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS); for (uint32 i = 0; i < _questMenu.GetMenuItemCount(); ++i) { QuestMenuItem const& qmi = _questMenu.GetItem(i); uint32 questID = qmi.QuestId; if (Quest const* quest = sObjectMgr->GetQuestTemplate(questID)) { ++count; std::string title = quest->GetTitle(); int32 locale = _session->GetSessionDbLocaleIndex(); if (locale >= 0) if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(questID)) ObjectMgr::GetLocaleString(localeData->Title, locale, title); if (questLevelInTitle) AddQuestLevelToTitle(title, quest->GetQuestLevel()); data << uint32(questID); data << uint32(qmi.QuestIcon); data << int32(quest->GetQuestLevel()); data << uint32(quest->GetFlags()); // 3.3.3 quest flags data << uint8(0); // 3.3.3 changes icon: blue question or yellow exclamation data << title; } } data.put<uint8>(count_pos, count); _session->SendPacket(&data); TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC Guid=%u", GUID_LOPART(npcGUID));}
开发者ID:Walkum,项目名称:SkyFire_5xx,代码行数:47,
示例6: ifvoid PlayerMenu::SendQuestGiverQuestList(ObjectGuid guid){ WorldPackets::Quest::QuestGiverQuestList questList; questList.QuestGiverGUID = guid; if (QuestGreeting const* questGreeting = sObjectMgr->GetQuestGreeting(guid)) { questList.GreetEmoteDelay = questGreeting->greetEmoteDelay; questList.GreetEmoteType = questGreeting->greetEmoteType; questList.Greeting = questGreeting->greeting; } else TC_LOG_ERROR("misc", "Guid: %s - No quest greeting found.", guid.ToString().c_str()); // Store this instead of checking the Singleton every loop iteration bool questLevelInTitle = sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS); for (uint32 i = 0; i < _questMenu.GetMenuItemCount(); ++i) { QuestMenuItem const& questMenuItem = _questMenu.GetItem(i); uint32 questID = questMenuItem.QuestId; if (Quest const* quest = sObjectMgr->GetQuestTemplate(questID)) { std::string title = quest->GetLogTitle(); LocaleConstant localeConstant = _session->GetSessionDbLocaleIndex(); if (localeConstant >= LOCALE_enUS) if (QuestTemplateLocale const* questTemplateLocale = sObjectMgr->GetQuestLocale(questID)) ObjectMgr::GetLocaleString(questTemplateLocale->LogTitle, localeConstant, title); if (questLevelInTitle) AddQuestLevelToTitle(title, quest->GetQuestLevel()); bool repeatable = false; // NYI bool ignored = false; // NYI questList.GossipTexts.push_back(WorldPackets::Quest::GossipTextData(questID, questMenuItem.QuestIcon, quest->GetQuestLevel(), quest->GetFlags(), quest->GetFlagsEx(), repeatable, ignored, title)); } } _session->SendPacket(questList.Write()); TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUEST_GIVER_QUEST_LIST_MESSAGE NPC=%s", guid.ToString().c_str());}
开发者ID:Diyvol,项目名称:TrinityCore,代码行数:45,
示例7: textvoid PlayerMenu::SendGossipMenu(uint32 titleTextId, ObjectGuid objectGUID){ _gossipMenu.SetSenderGUID(objectGUID); WorldPackets::NPC::GossipMessage packet; packet.GossipGUID = objectGUID; packet.GossipID = _gossipMenu.GetMenuId(); packet.TextID = titleTextId; packet.GossipOptions.resize(_gossipMenu.GetMenuItems().size()); uint32 count = 0; for (GossipMenuItemContainer::const_iterator itr = _gossipMenu.GetMenuItems().begin(); itr != _gossipMenu.GetMenuItems().end(); ++itr) { WorldPackets::NPC::ClientGossipOptions& opt = packet.GossipOptions[count]; GossipMenuItem const& item = itr->second; opt.ClientOption = itr->first; opt.OptionNPC = item.MenuItemIcon; opt.OptionFlags = item.IsCoded; // makes pop up box password opt.OptionCost = item.BoxMoney; // money required to open menu, 2.0.3 opt.Text = item.Message; // text for gossip item opt.Confirm = item.BoxMessage; // accept text (related to money) pop up box, 2.0.3 ++count; } // Store this instead of checking the Singleton every loop iteration bool questLevelInTitle = sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS); packet.GossipText.resize(_questMenu.GetMenuItemCount()); count = 0; for (uint8 i = 0; i < _questMenu.GetMenuItemCount(); ++i) { QuestMenuItem const& item = _questMenu.GetItem(i); uint32 questID = item.QuestId; if (Quest const* quest = sObjectMgr->GetQuestTemplate(questID)) { WorldPackets::NPC::ClientGossipText& text = packet.GossipText[count]; text.QuestID = questID; text.QuestType = item.QuestIcon; text.QuestLevel = quest->GetQuestLevel(); text.QuestFlags[0] = quest->GetFlags(); text.QuestFlags[1] = quest->GetFlagsEx(); text.Repeatable = quest->IsRepeatable(); std::string title = quest->GetLogTitle(); LocaleConstant localeConstant = _session->GetSessionDbLocaleIndex(); if (localeConstant >= LOCALE_enUS) if (QuestTemplateLocale const* localeData = sObjectMgr->GetQuestLocale(questID)) ObjectMgr::GetLocaleString(localeData->LogTitle, localeConstant, title); if (questLevelInTitle) AddQuestLevelToTitle(title, quest->GetQuestLevel()); text.QuestTitle = title; ++count; } } // Shrink to the real size packet.GossipText.resize(count); _session->SendPacket(packet.Write());}
开发者ID:Diyvol,项目名称:TrinityCore,代码行数:62,
示例8: AddQuestLevelToTitlevoid PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGuid, bool enableNext) const{ std::string questTitle = quest->GetTitle(); std::string questOfferRewardText = quest->GetOfferRewardText(); std::string questGiverTextWindow = quest->GetQuestGiverTextWindow(); std::string questGiverTargetName = quest->GetQuestGiverTargetName(); std::string questTurnTextWindow = quest->GetQuestTurnTextWindow(); std::string questTurnTargetName = quest->GetQuestTurnTargetName(); int32 locale = _session->GetSessionDbLocaleIndex(); if (locale >= 0) { if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(quest->GetQuestId())) { ObjectMgr::GetLocaleString(localeData->Title, locale, questTitle); ObjectMgr::GetLocaleString(localeData->OfferRewardText, locale, questOfferRewardText); ObjectMgr::GetLocaleString(localeData->QuestGiverTextWindow, locale, questGiverTextWindow); ObjectMgr::GetLocaleString(localeData->QuestGiverTargetName, locale, questGiverTargetName); ObjectMgr::GetLocaleString(localeData->QuestTurnTextWindow, locale, questTurnTextWindow); ObjectMgr::GetLocaleString(localeData->QuestTurnTargetName, locale, questTurnTargetName); } } if (sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS)) AddQuestLevelToTitle(questTitle, quest->GetQuestLevel()); uint32 rewItemDisplayId[QUEST_REWARDS_COUNT]; for (uint8 i = 0; i < QUEST_REWARDS_COUNT; i++) { ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardItemId[i]); rewItemDisplayId[i] = itemTemplate ? itemTemplate->DisplayInfoID : 0; } uint32 rewChoiceItemDisplayId[QUEST_REWARD_CHOICES_COUNT]; for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; i++) { ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardChoiceItemId[i]); rewChoiceItemDisplayId[i] = itemTemplate ? itemTemplate->DisplayInfoID : 0; } uint32 rewEmoteCount = 0; for (uint8 i = 0; i < QUEST_EMOTE_COUNT; i++) { if (quest->OfferRewardEmote[i] <= 0) break; rewEmoteCount++; } /* * TODO: Quest System * * Finish structure, missing values: * SuggestedPartyMembers, FactionFlags, SkillLineID, NumSkillUps, SpellCompletionID, SpellCompletionDisplayID */ ObjectGuid guid = npcGuid; WorldPacket data(SMSG_QUESTGIVER_OFFER_REWARD, 50); // guess size data << uint32(quest->RewardItemIdCount[2]); data << uint32(quest->GetQuestId()); data << uint32(quest->RewardItemId[3]); data << uint32(rewChoiceItemDisplayId[2]); for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; i++) { data << uint32(quest->RewardFactionId[i]); data << uint32(quest->RewardFactionValueId[i]); data << uint32(quest->RewardFactionValueIdOverride[i]); } data << uint32(quest->RewardItemIdCount[0]); data << uint32(quest->RewardItemIdCount[3]); data << uint32(rewItemDisplayId[3]); data << uint32(quest->RewardItemId[1]); data << uint32(quest->RewardChoiceItemId[3]); data << uint32(rewChoiceItemDisplayId[3]); data << uint32(quest->GetRewChoiceItemsCount()); data << uint32(quest->GetRewSpellCast()); data << uint32(rewItemDisplayId[1]); data << uint32(quest->RewardChoiceItemCount[5]); data << uint32(rewChoiceItemDisplayId[4]); data << uint32(quest->RewardChoiceItemCount[1]); data << uint32(rewChoiceItemDisplayId[0]); data << uint32(rewItemDisplayId[0]); data << uint32(quest->GetRewardPackageItemId()); data << uint32(0); // model Id, usually used in wanted or boss quests data << uint32(quest->RewardItemIdCount[1]); data << uint32(0); data << uint32(quest->RewardChoiceItemId[0]); data << uint32(quest->RewardChoiceItemCount[3]); data << uint32(quest->RewardChoiceItemCount[4]); data << uint32(quest->RewardChoiceItemId[1]); data << uint32(quest->GetBonusTalents()); data << uint32(0); for (uint8 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; i++) { data << uint32(quest->RewardCurrencyId[i]); data << uint32(quest->RewardCurrencyCount[i]);//.........这里部分代码省略.........
开发者ID:Ayik0,项目名称:DeathCore_5.4.8,代码行数:101,
示例9: AddQuestLevelToTitlevoid PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, bool enableNext) const{ std::string questTitle = quest->GetTitle(); std::string questOfferRewardText = quest->GetOfferRewardText(); int32 locale = _session->GetSessionDbLocaleIndex(); if (locale >= 0) { if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(quest->GetQuestId())) { ObjectMgr::GetLocaleString(localeData->Title, locale, questTitle); ObjectMgr::GetLocaleString(localeData->OfferRewardText, locale, questOfferRewardText); } } if (sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS)) AddQuestLevelToTitle(questTitle, quest->GetQuestLevel()); WorldPacket data(SMSG_QUESTGIVER_OFFER_REWARD, 50); // guess size data << uint64(npcGUID); data << uint32(quest->GetQuestId()); data << questTitle; data << questOfferRewardText; data << uint8(enableNext ? 1 : 0); // Auto Finish data << uint32(quest->GetFlags()); // 3.3.3 questFlags data << uint32(quest->GetSuggestedPlayers()); // SuggestedGroupNum uint32 emoteCount = 0; for (uint8 i = 0; i < QUEST_EMOTE_COUNT; ++i) { if (quest->OfferRewardEmote[i] <= 0) break; ++emoteCount; } data << emoteCount; // Emote Count for (uint8 i = 0; i < emoteCount; ++i) { data << uint32(quest->OfferRewardEmoteDelay[i]); // Delay Emote data << uint32(quest->OfferRewardEmote[i]); } data << uint32(quest->GetRewChoiceItemsCount()); for (uint32 i=0; i < quest->GetRewChoiceItemsCount(); ++i) { data << uint32(quest->RewardChoiceItemId[i]); data << uint32(quest->RewardChoiceItemCount[i]); if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardChoiceItemId[i])) data << uint32(itemTemplate->DisplayInfoID); else data << uint32(0); } data << uint32(quest->GetRewItemsCount()); for (uint32 i = 0; i < quest->GetRewItemsCount(); ++i) { data << uint32(quest->RewardItemId[i]); data << uint32(quest->RewardItemIdCount[i]); if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardItemId[i])) data << uint32(itemTemplate->DisplayInfoID); else data << uint32(0); } data << uint32(quest->GetRewOrReqMoney()); data << uint32(quest->XPValue(_session->GetPlayer()) * sWorld->getRate(RATE_XP_QUEST)); // rewarded honor points. Multiply with 10 to satisfy client data << uint32(10 * quest->CalculateHonorGain(_session->GetPlayer()->GetQuestLevel(quest))); data << float(0.0f); // unk, honor multiplier? data << uint32(0x08); // unused by client? data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) data << int32(quest->GetRewSpellCast()); // casted spell data << uint32(0); // unknown data << uint32(quest->GetBonusTalents()); // bonus talents data << uint32(quest->GetRewArenaPoints()); // arena points data << uint32(0); for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward factions ids data << uint32(quest->RewardFactionId[i]); for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // columnid in QuestFactionReward.dbc (zero based)? data << int32(quest->RewardFactionValueId[i]); for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward reputation override? data << uint32(quest->RewardFactionValueIdOverride[i]); _session->SendPacket(&data); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId());}
开发者ID:Auter,项目名称:TrinityCore,代码行数:93,
示例10: ObjectGuidvoid PlayerMenu::SendGossipMenu(uint32 titleTextId, uint64 objectGUID) const{ std::string updatedQuestTitles[0x20]; ObjectGuid guid = ObjectGuid(objectGUID); WorldPacket data(SMSG_GOSSIP_MESSAGE, 150); //??? GUESSED data.WriteBit(guid[7]); data.WriteBit(guid[6]); data.WriteBit(guid[1]); data.WriteBits(_questMenu.GetMenuItemCount(), 19); // max count 0x20 data.WriteBit(guid[0]); data.WriteBit(guid[4]); data.WriteBit(guid[5]); data.WriteBit(guid[2]); data.WriteBit(guid[3]); data.WriteBits(_gossipMenu.GetMenuItemCount(), 20); // max count 0x10 for (GossipMenuItemContainer::const_iterator itr = _gossipMenu.GetMenuItems().begin(); itr != _gossipMenu.GetMenuItems().end(); ++itr) { GossipMenuItem const& item = itr->second; data.WriteBits(item.BoxMessage.length(), 12); data.WriteBits(item.Message.length(), 12); } // Store this instead of checking the Singleton every loop iteration bool questLevelInTitle = sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS); for (uint8 i = 0; i < _questMenu.GetMenuItemCount(); ++i) { uint32 questId = _questMenu.GetItem(i).QuestId; Quest const* quest = sObjectMgr->GetQuestTemplate(questId); std::string title = quest->GetTitle(); int32 locale = _session->GetSessionDbLocaleIndex(); if (locale >= 0) if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(questId)) ObjectMgr::GetLocaleString(localeData->Title, locale, title); if (questLevelInTitle) AddQuestLevelToTitle(title, quest->GetQuestLevel()); if (title.length() % 2 != 0) title += " "; // if quest title length is odd dividing by 2 will cause precision loss, add a space to the end data.WriteBit(0); // unknown bit data.WriteBits(title.length() / 2, 8); // title length is divided by 2 data.WriteBit(0); // unknown bit updatedQuestTitles[i] = title; } data.FlushBits(); for (uint8 i = 0; i < _questMenu.GetMenuItemCount(); ++i) { QuestMenuItem const& item = _questMenu.GetItem(i); Quest const* quest = sObjectMgr->GetQuestTemplate(item.QuestId); data << int32(quest->GetSpecialFlags()); data << int32(item.QuestId); data << int32(quest->GetQuestLevel()); data << int32(item.QuestIcon); data << int32(quest->GetFlags()); data.WriteString(updatedQuestTitles[i]); // max 0xFF?, length is stored in 8 bits, 5.4.1 } data.WriteByteSeq(guid[6]); for (GossipMenuItemContainer::const_iterator itr = _gossipMenu.GetMenuItems().begin(); itr != _gossipMenu.GetMenuItems().end(); ++itr) { GossipMenuItem const& item = itr->second; data << int32(item.BoxMoney); // money required to open menu, 2.0.3 data.WriteString(item.Message); // text for gossip item data << int32(itr->first); data << int8(item.MenuItemIcon); data.WriteString(item.BoxMessage); // accept text (related to money) pop up box, 2.0. data << int8(item.IsCoded); // makes pop up box password } data.WriteByteSeq(guid[2]); data << int32(titleTextId); data.WriteByteSeq(guid[1]); data.WriteByteSeq(guid[5]); data << int32(_gossipMenu.GetMenuId()); // new 2.4.0 data << int32(0); // friend faction ID? data.WriteByteSeq(guid[4]); data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[3]); data.WriteByteSeq(guid[0]); _session->SendPacket(&data);}
开发者ID:Walkum,项目名称:SkyFire_5xx,代码行数:100,
示例11: AddQuestLevelToTitlevoid PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, bool activateAccept) const{ std::string questTitle = quest->GetTitle(); std::string questDetails = quest->GetDetails(); std::string questObjectives = quest->GetObjectives(); std::string questGiverTextWindow = quest->GetQuestGiverTextWindow(); std::string questGiverTargetName = quest->GetQuestGiverTargetName(); std::string questTurnTextWindow = quest->GetQuestTurnTextWindow(); std::string questTurnTargetName = quest->GetQuestTurnTargetName(); int32 locale = _session->GetSessionDbLocaleIndex(); if (locale >= 0) { if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(quest->GetQuestId())) { ObjectMgr::GetLocaleString(localeData->Title, locale, questTitle); ObjectMgr::GetLocaleString(localeData->Details, locale, questDetails); ObjectMgr::GetLocaleString(localeData->Objectives, locale, questObjectives); ObjectMgr::GetLocaleString(localeData->QuestGiverTextWindow, locale, questGiverTextWindow); ObjectMgr::GetLocaleString(localeData->QuestGiverTargetName, locale, questGiverTargetName); ObjectMgr::GetLocaleString(localeData->QuestTurnTextWindow, locale, questTurnTextWindow); ObjectMgr::GetLocaleString(localeData->QuestTurnTargetName, locale, questTurnTargetName); } } if (sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS)) AddQuestLevelToTitle(questTitle, quest->GetQuestLevel()); /* * -- Objective Structure -- * uint32 - objective count (value required to complete objective) * uint32 - objective Id (NPC, GO, item, spell, currency or faction Id) * uint8 - objective type (see QuestObjectiveType enum) * uint32 - unknown */ ByteBuffer objData; int objCount = 0; for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; i++) { if (quest->RequiredNpcOrGo[i] != 0) { int32 requiredObjId = quest->RequiredNpcOrGo[i]; objData << uint8(requiredObjId < 0 ? QUEST_OBJECTIVE_TYPE_GO : QUEST_OBJECTIVE_TYPE_NPC); objData << uint32(0); objData << int32(quest->RequiredNpcOrGoCount[i]); objData << uint32(requiredObjId < 0 ? requiredObjId * -1 : requiredObjId); objCount++; } } for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++) { if (quest->RequiredItemId[i] != 0) { objData << uint8(QUEST_OBJECTIVE_TYPE_ITEM); objData << uint32(0); objData << int32(quest->RequiredItemCount[i]); objData << uint32(quest->RequiredItemId[i]); objCount++; } } for (uint8 i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; i++) { if (quest->RequiredCurrencyId[i] != 0) { objData << uint8(QUEST_OBJECTIVE_TYPE_CURRENCY); objData << uint32(0); objData << int32(quest->RequiredCurrencyCount[i]); objData << uint32(quest->RequiredCurrencyId[i]); objCount++; } } if (quest->GetRequiredSpell() != 0) { objData << uint8(QUEST_OBJECTIVE_TYPE_SPELL); objData << uint32(0); objData << int32(1); objData << uint32(quest->GetRequiredSpell()); objCount++; } if (quest->GetRepObjectiveFaction() != 0) { objData << uint8(QUEST_OBJECTIVE_TYPE_FACTION_REP); objData << uint32(0); objData << int32(quest->GetRepObjectiveValue()); objData << uint32(quest->GetRepObjectiveFaction()); objCount++; }//.........这里部分代码省略.........
开发者ID:Allowed,项目名称:SkyFire_5xx,代码行数:101,
示例12: SendQuestGiverOfferRewardvoid PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, bool canComplete, bool closeOnCancel) const{ // We can always call to RequestItems, but this packet only goes out if there are actually // items. Otherwise, we'll skip straight to the OfferReward std::string questTitle = quest->GetTitle(); std::string requestItemsText = quest->GetRequestItemsText(); int32 locale = _session->GetSessionDbLocaleIndex(); if (locale >= 0) { if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(quest->GetQuestId())) { ObjectMgr::GetLocaleString(localeData->Title, locale, questTitle); ObjectMgr::GetLocaleString(localeData->RequestItemsText, locale, requestItemsText); } } if (!quest->GetReqItemsCount() && canComplete) { SendQuestGiverOfferReward(quest, npcGUID, true); return; } if (sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS)) AddQuestLevelToTitle(questTitle, quest->GetQuestLevel()); ObjectGuid guid = npcGUID; WorldPacket data(SMSG_QUESTGIVER_REQUEST_ITEMS, 50); // guess size data << uint32(0); data << uint32(quest->GetFlags()); data << uint32(0); data << uint32(canComplete ? 0x5F : 0x5B); // unknown, if not 5F continue button is greyed out data << uint32(quest->GetRewOrReqMoney() < 0 ? -quest->GetRewOrReqMoney() : 0); data << uint32(0); // quest starter NPC/GO entry data << uint32(0); data << uint32(canComplete ? quest->GetCompleteEmote() : quest->GetIncompleteEmote()); data << uint32(quest->GetQuestId()); data.WriteBits(quest->GetReqCurrencyCount(), 21); data.WriteBit(closeOnCancel); data.WriteBit(guid[2]); data.WriteBit(guid[5]); data.WriteBit(guid[1]); data.WriteBits(questTitle.size(), 9); data.WriteBits(requestItemsText.size(), 12); data.WriteBit(guid[6]); data.WriteBit(guid[0]); data.WriteBits(quest->GetReqItemsCount(), 20); data.WriteBit(guid[4]); data.WriteBit(guid[7]); data.WriteBit(guid[3]); data.FlushBits(); data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[2]); data.WriteString(questTitle); for (int i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; i++) { if (!quest->RequiredCurrencyId[i]) continue; data << uint32(quest->RequiredCurrencyId[i]); data << uint32(quest->RequiredCurrencyCount[i]); } for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++) { if (!quest->RequiredItemId[i]) continue; if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RequiredItemId[i])) data << uint32(itemTemplate->DisplayInfoID); else data << uint32(0); data << uint32(quest->RequiredItemId[i]); data << uint32(quest->RequiredItemCount[i]); } data.WriteByteSeq(guid[3]); data.WriteByteSeq(guid[1]); data.WriteString(requestItemsText); data.WriteByteSeq(guid[4]); data.WriteByteSeq(guid[5]); data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[6]); _session->SendPacket(&data); // missing from Cata - quest->GetSuggestedPlayers() TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId());}
开发者ID:Allowed,项目名称:SkyFire_5xx,代码行数:96,
示例13: SendQuestGiverOfferRewardvoid PlayerMenu::SendQuestGiverRequestItems(Quest const* pQuest, uint64 npcGUID, bool Completable, bool CloseOnCancel){ // We can always call to RequestItems, but this packet only goes out if there are actually // items. Otherwise, we'll skip straight to the OfferReward std::string Title = pQuest->GetTitle(); std::string RequestItemsText = pQuest->GetRequestItemsText(); int loc_idx = pSession->GetSessionDbLocaleIndex(); if (loc_idx >= 0) { if (QuestLocale const* ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId())) { if (ql->Title.size() > uint32(loc_idx) && !ql->Title[loc_idx].empty()) Title = ql->Title[loc_idx]; if (ql->RequestItemsText.size() > uint32(loc_idx) && !ql->RequestItemsText[loc_idx].empty()) RequestItemsText = ql->RequestItemsText[loc_idx]; } } // We may wish a better check, perhaps checking the real quest requirements if (pQuest->GetRequestItemsText().empty() && Completable) { SendQuestGiverOfferReward(pQuest, npcGUID, true); return; } if (sWorld.getConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS)) AddQuestLevelToTitle(Title, pQuest->GetQuestLevel()); WorldPacket data(SMSG_QUESTGIVER_REQUEST_ITEMS, 50); // guess size data << uint64(npcGUID); data << uint32(pQuest->GetQuestId()); data << Title; data << RequestItemsText; data << uint32(0x00); // unknown if (Completable) data << pQuest->GetCompleteEmote(); else data << pQuest->GetIncompleteEmote(); // Close Window after cancel if (CloseOnCancel) data << uint32(0x01); else data << uint32(0x00); data << uint32(0x00); // unknown // Required Money data << uint32(pQuest->GetRewOrReqMoney() < 0 ? -pQuest->GetRewOrReqMoney() : 0); data << uint32(pQuest->GetReqItemsCount()); ItemTemplate const* pItem; for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) { if (!pQuest->RequiredItemId[i]) continue; pItem = sObjectMgr.GetItemTemplate(pQuest->RequiredItemId[i]); data << uint32(pQuest->RequiredItemId[i]); data << uint32(pQuest->ReqItemCount[i]); if (pItem) data << uint32(pItem->DisplayInfoID); else data << uint32(0); } if (!Completable) data << uint32(0x00); else data << uint32(0x03); data << uint32(0x04); data << uint32(0x08); data << uint32(0x10); pSession->SendPacket(&data); sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId());}
开发者ID:Phentora,项目名称:OregonCore,代码行数:84,
示例14: AddQuestLevelToTitlevoid PlayerMenu::SendQuestGiverQuestDetails(Quest const* pQuest, uint64 npcGUID, bool ActivateAccept){ std::string Title = pQuest->GetTitle(); std::string Details = pQuest->GetDetails(); std::string Objectives = pQuest->GetObjectives(); std::string EndText = pQuest->GetEndText(); int loc_idx = pSession->GetSessionDbLocaleIndex(); if (loc_idx >= 0) { QuestLocale const* ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId()); if (ql) { if (ql->Title.size() > uint32(loc_idx) && !ql->Title[loc_idx].empty()) Title = ql->Title[loc_idx]; if (ql->Details.size() > uint32(loc_idx) && !ql->Details[loc_idx].empty()) Details = ql->Details[loc_idx]; if (ql->Objectives.size() > uint32(loc_idx) && !ql->Objectives[loc_idx].empty()) Objectives = ql->Objectives[loc_idx]; if (ql->EndText.size() > uint32(loc_idx) && !ql->EndText[loc_idx].empty()) EndText = ql->EndText[loc_idx]; } } if (sWorld.getConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS)) AddQuestLevelToTitle(Title, pQuest->GetQuestLevel()); WorldPacket data(SMSG_QUESTGIVER_QUEST_DETAILS, 100); // guess size data << uint64(npcGUID); data << uint32(pQuest->GetQuestId()); data << Title; data << Details; data << Objectives; data << uint32(ActivateAccept); data << uint32(pQuest->GetSuggestedPlayers()); if (pQuest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS)) { data << uint32(0); // Rewarded chosen items hidden data << uint32(0); // Rewarded items hidden data << uint32(0); // Rewarded money hidden } else { ItemTemplate const* IProto; data << uint32(pQuest->GetRewChoiceItemsCount()); for (uint32 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) { if (!pQuest->RewChoiceItemId[i]) continue; data << uint32(pQuest->RewChoiceItemId[i]); data << uint32(pQuest->RewChoiceItemCount[i]); IProto = sObjectMgr.GetItemTemplate(pQuest->RewChoiceItemId[i]); if (IProto) data << uint32(IProto->DisplayInfoID); else data << uint32(0x00); } data << uint32(pQuest->GetRewItemsCount()); for (uint32 i = 0; i < QUEST_REWARDS_COUNT; ++i) { if (!pQuest->RewItemId[i]) continue; data << uint32(pQuest->RewItemId[i]); data << uint32(pQuest->RewItemCount[i]); IProto = sObjectMgr.GetItemTemplate(pQuest->RewItemId[i]); if (IProto) data << uint32(IProto->DisplayInfoID); else data << uint32(0); } data << uint32(pQuest->GetRewOrReqMoney()); } // rewarded honor points. Multiply with 10 to satisfy client data << uint32(10 * Oregon::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills())); data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) data << uint32(pQuest->GetRewSpellCast()); // casted spell data << uint32(pQuest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) data << uint32(QUEST_EMOTE_COUNT); for (uint32 i = 0; i < QUEST_EMOTE_COUNT; ++i) { data << uint32(pQuest->DetailsEmote[i]); data << uint32(0); // DetailsEmoteDelay } pSession->SendPacket(&data); DEBUG_LOG("WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId());}
开发者ID:Phentora,项目名称:OregonCore,代码行数:98,
示例15: AddQuestLevelToTitlevoid PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, bool activateAccept) const{ std::string questTitle = quest->GetTitle(); std::string questDetails = quest->GetDetails(); std::string questObjectives = quest->GetObjectives(); std::string questEndText = quest->GetEndText(); std::string questGiverTextWindow = quest->GetQuestGiverTextWindow(); std::string questGiverTargetName = quest->GetQuestGiverTargetName(); std::string questTurnTextWindow = quest->GetQuestTurnTextWindow(); std::string questTurnTargetName = quest->GetQuestTurnTargetName(); int32 locale = _session->GetSessionDbLocaleIndex(); if (locale >= 0) { if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(quest->GetQuestId())) { ObjectMgr::GetLocaleString(localeData->Title, locale, questTitle); ObjectMgr::GetLocaleString(localeData->Details, locale, questDetails); ObjectMgr::GetLocaleString(localeData->Objectives, locale, questObjectives); ObjectMgr::GetLocaleString(localeData->EndText, locale, questEndText); ObjectMgr::GetLocaleString(localeData->QuestGiverTextWindow, locale, questGiverTextWindow); ObjectMgr::GetLocaleString(localeData->QuestGiverTargetName, locale, questGiverTargetName); ObjectMgr::GetLocaleString(localeData->QuestTurnTextWindow, locale, questTurnTextWindow); ObjectMgr::GetLocaleString(localeData->QuestTurnTargetName, locale, questTurnTargetName); } } if (sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS)) AddQuestLevelToTitle(questTitle, quest->GetQuestLevel()); WorldPacket data(SMSG_QUESTGIVER_QUEST_DETAILS, 100); // guess size data << uint64(npcGUID); data << uint64(_session->GetPlayer()->GetDivider()); data << uint32(quest->GetQuestId()); data << questTitle; data << questDetails; data << questObjectives; data << questGiverTextWindow; // 4.x data << questGiverTargetName; // 4.x data << questTurnTextWindow; // 4.x data << questTurnTargetName; // 4.x data << uint32(quest->GetQuestGiverPortrait()); // 4.x data << uint32(quest->GetQuestTurnInPortrait()); // 4.x data << uint8(activateAccept ? 1 : 0); // auto finish data << uint32(quest->GetFlags()); // 3.3.3 questFlags data << uint32(quest->GetSuggestedPlayers()); data << uint8(0); // IsFinished? value is sent back to server in quest accept packet data << uint8(0); // 4.x FIXME: Starts at AreaTrigger data << uint32(quest->GetRequiredSpell()); // 4.x quest->BuildExtraQuestInfo(data, _session->GetPlayer()); data << uint32(QUEST_EMOTE_COUNT); for (uint8 i = 0; i < QUEST_EMOTE_COUNT; ++i) { data << uint32(quest->DetailsEmote[i]); data << uint32(quest->DetailsEmoteDelay[i]); // DetailsEmoteDelay (in ms) } _session->SendPacket(&data); TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId());}
开发者ID:Walkum,项目名称:SkyFire_5xx,代码行数:62,
示例16: SendQuestGiverOfferRewardvoid PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, ObjectGuid npcGUID, bool canComplete, bool closeOnCancel) const{ // We can always call to RequestItems, but this packet only goes out if there are actually // items. Otherwise, we'll skip straight to the OfferReward std::string questTitle = quest->GetLogTitle(); std::string requestItemsText = quest->GetRequestItemsText(); LocaleConstant locale = _session->GetSessionDbLocaleIndex(); if (locale >= LOCALE_enUS) { if (QuestTemplateLocale const* questTemplateLocale = sObjectMgr->GetQuestLocale(quest->GetQuestId())) { ObjectMgr::GetLocaleString(questTemplateLocale->LogTitle, locale, questTitle); ObjectMgr::GetLocaleString(questTemplateLocale->RequestItemsText, locale, requestItemsText); } } if (!quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER) && canComplete) { SendQuestGiverOfferReward(quest, npcGUID, true); return; } if (sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS)) AddQuestLevelToTitle(questTitle, quest->GetQuestLevel()); WorldPackets::Quest::QuestGiverRequestItems packet; packet.QuestGiverGUID = npcGUID; // Is there a better way? what about game objects? if (Creature const* creature = ObjectAccessor::GetCreature(*_session->GetPlayer(), npcGUID)) packet.QuestGiverCreatureID = creature->GetCreatureTemplate()->Entry; packet.QuestID = quest->GetQuestId(); if (canComplete) { packet.CompEmoteDelay = quest->EmoteOnCompleteDelay; packet.CompEmoteType = quest->EmoteOnComplete; } else { packet.CompEmoteDelay = quest->EmoteOnIncompleteDelay; packet.CompEmoteType = quest->EmoteOnIncomplete; } packet.QuestFlags[0] = quest->GetFlags(); packet.QuestFlags[1] = quest->GetFlagsEx(); packet.SuggestPartyMembers = quest->GetSuggestedPlayers(); packet.StatusFlags = 0xDF; // Unk, send common value packet.MoneyToGet = 0; for (QuestObjective const& obj : quest->GetObjectives()) { switch (obj.Type) { case QUEST_OBJECTIVE_ITEM: packet.Collect.push_back(WorldPackets::Quest::QuestObjectiveCollect(obj.ObjectID, obj.Amount, obj.Flags)); break; case QUEST_OBJECTIVE_CURRENCY: packet.Currency.push_back(WorldPackets::Quest::QuestCurrency(obj.ObjectID, obj.Amount)); break; case QUEST_OBJECTIVE_MONEY: packet.MoneyToGet += obj.Amount; break; default: break; } } packet.AutoLaunched = closeOnCancel; packet.QuestTitle = questTitle; packet.CompletionText = requestItemsText; _session->SendPacket(packet.Write()); TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPC=%s, questid=%u", npcGUID.ToString().c_str(), quest->GetQuestId());}
开发者ID:Diyvol,项目名称:TrinityCore,代码行数:78,
示例17: data//.........这里部分代码省略......... data << uint32(quest->GetType()); // quest type data << uint32(quest->GetSuggestedPlayers()); // suggested players count data << uint32(quest->GetRepObjectiveFaction()); // shown in quest log as part of quest objective data << uint32(quest->GetRepObjectiveValue()); // shown in quest log as part of quest objective data << uint32(quest->GetRepObjectiveFaction2()); // shown in quest log as part of quest objective OPPOSITE faction data << uint32(quest->GetRepObjectiveValue2()); // shown in quest log as part of quest objective OPPOSITE faction data << uint32(quest->GetNextQuestInChain()); // client will request this quest from NPC, if not 0 data << uint32(quest->GetXPId()); // used for calculating rewarded experience if (quest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS)) data << uint32(0); // Hide money rewarded else data << uint32(quest->GetRewOrReqMoney()); // reward money (below max lvl) data << uint32(quest->GetRewMoneyMaxLevel()); // used in XP calculation at client data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (cast if RewSpellCast == 0) data << int32(quest->GetRewSpellCast()); // cast spell // rewarded honor points data << uint32(quest->GetRewHonorAddition()); data << float(quest->GetRewHonorMultiplier()); data << uint32(quest->GetSrcItemId()); // source item id data << uint32(quest->GetFlags() & 0xFFFF); // quest flags data << uint32(quest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) data << uint32(quest->GetPlayersSlain()); // players slain data << uint32(quest->GetBonusTalents()); // bonus talents data << uint32(quest->GetRewArenaPoints()); // bonus arena points data << uint32(0); // review rep show mask if (quest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS)) { for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) data << uint32(0) << uint32(0); for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) data << uint32(0) << uint32(0); } else { for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) { data << uint32(quest->RewardItemId[i]); data << uint32(quest->RewardItemIdCount[i]); } for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) { data << uint32(quest->RewardChoiceItemId[i]); data << uint32(quest->RewardChoiceItemCount[i]); } } for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward factions ids data << uint32(quest->RewardFactionId[i]); for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // columnid+1 QuestFactionReward.dbc? data << int32(quest->RewardFactionValueId[i]); for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // unk (0) data << int32(quest->RewardFactionValueIdOverride[i]); data << uint32(quest->GetPOIContinent()); data << float(quest->GetPOIx()); data << float(quest->GetPOIy()); data << uint32(quest->GetPointOpt()); if (sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS)) AddQuestLevelToTitle(questTitle, quest->GetQuestLevel()); data << questTitle; data << questObjectives; data << questDetails; data << questAreaDescription; data << questCompletedText; // display in quest objectives window once all objectives are completed for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) { if (quest->RequiredNpcOrGo[i] < 0) data << uint32((quest->RequiredNpcOrGo[i] * (-1)) | 0x80000000); // client expects gameobject template id in form (id|0x80000000) else data << uint32(quest->RequiredNpcOrGo[i]); data << uint32(quest->RequiredNpcOrGoCount[i]); data << uint32(quest->ItemDrop[i]); data << uint32(0); // req source count? } for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { data << uint32(quest->RequiredItemId[i]); data << uint32(quest->RequiredItemCount[i]); } for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) data << questObjectiveText[i]; _session->SendPacket(&data); TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", quest->GetQuestId());}
开发者ID:boom8866,项目名称:MaddieCore,代码行数:101,
示例18: questObjectiveDescription//.........这里部分代码省略......... packet.Info.QuestID = quest->GetQuestId(); packet.Info.QuestType = quest->GetQuestType(); packet.Info.QuestLevel = quest->GetQuestLevel(); packet.Info.QuestPackageID = quest->GetQuestPackageID(); packet.Info.QuestMinLevel = quest->GetMinLevel(); packet.Info.QuestSortID = quest->GetZoneOrSort(); packet.Info.QuestInfoID = quest->GetQuestInfoID(); packet.Info.SuggestedGroupNum = quest->GetSuggestedPlayers(); packet.Info.RewardNextQuest = quest->GetNextQuestInChain(); packet.Info.RewardXPDifficulty = quest->GetXPDifficulty(); packet.Info.Float10 = quest->Float10; // Unk packet.Info.Float13 = quest->Float13; // Unk if (quest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS)) packet.Info.RewardMoney = quest->RewardMoney; packet.Info.RewardMoneyDifficulty = quest->GetRewMoneyDifficulty(); packet.Info.RewardBonusMoney = quest->GetRewMoneyMaxLevel(); packet.Info.RewardDisplaySpell = quest->GetRewDisplaySpell(); packet.Info.RewardSpell = quest->GetRewSpell(); packet.Info.RewardHonor = quest->GetRewHonor(); packet.Info.RewardKillHonor = quest->GetRewKillHonor(); packet.Info.StartItem = quest->GetSrcItemId(); packet.Info.Flags = quest->GetFlags(); packet.Info.FlagsEx = quest->GetFlagsEx(); packet.Info.RewardTitle = quest->GetRewTitle(); packet.Info.RewardTalents = quest->GetBonusTalents(); packet.Info.RewardArenaPoints = quest->GetRewArenaPoints(); packet.Info.RewardSkillLineID = quest->GetRewardSkillId(); packet.Info.RewardNumSkillUps = quest->GetRewardSkillPoints(); packet.Info.RewardFactionFlags = quest->GetRewardReputationMask(); packet.Info.PortraitGiver = quest->GetQuestGiverPortrait(); packet.Info.PortraitTurnIn = quest->GetQuestTurnInPortrait(); if (!quest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS)) { for (uint8 i = 0; i < QUEST_REWARD_ITEM_COUNT; ++i) { packet.Info.RewardItems[i] = quest->RewardItemId[i]; packet.Info.RewardAmount[i] = quest->RewardItemCount[i]; } for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) { packet.Info.UnfilteredChoiceItems[i].ItemID = quest->RewardChoiceItemId[i]; packet.Info.UnfilteredChoiceItems[i].Quantity = quest->RewardChoiceItemCount[i]; } } for (uint8 i = 0; i < QUEST_REWARD_REPUTATIONS_COUNT; ++i) { packet.Info.RewardFactionID[i] = quest->RewardFactionId[i]; packet.Info.RewardFactionValue[i] = quest->RewardFactionValue[i]; packet.Info.RewardFactionOverride[i] = quest->RewardFactionOverride[i]; } packet.Info.POIContinent = quest->GetPOIContinent(); packet.Info.POIx = quest->GetPOIx(); packet.Info.POIy = quest->GetPOIy(); packet.Info.POIPriority = quest->GetPOIPriority(); if (sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS)) AddQuestLevelToTitle(questLogTitle, quest->GetQuestLevel()); packet.Info.LogTitle = questLogTitle; packet.Info.LogDescription = questLogDescription; packet.Info.QuestDescription = questDescription; packet.Info.AreaDescription = areaDescription; packet.Info.QuestCompletionLog = questCompletionLog; packet.Info.AllowableRaces = quest->GetAllowableRaces(); for (QuestObjective const& obj : quest->Objectives) { packet.Info.Objectives.push_back(obj); // @todo update quets objective locales //packet.Info.Objectives.back().Description = questObjectiveDescription[i]; } for (uint32 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) { packet.Info.RewardCurrencyID[i] = quest->RewardCurrencyId[i]; packet.Info.RewardCurrencyQty[i] = quest->RewardCurrencyCount[i]; } packet.Info.PortraitGiverText = portraitGiverText; packet.Info.PortraitGiverName = portraitGiverName; packet.Info.PortraitTurnInText = portraitTurnInText; packet.Info.PortraitTurnInName = portraitTurnInName; packet.Info.AcceptedSoundKitID = quest->GetSoundAccept(); packet.Info.CompleteSoundKitID = quest->GetSoundTurnIn(); packet.Info.AreaGroupID = quest->GetAreaGroupID(); packet.Info.TimeAllowed = quest->GetLimitTime(); _session->SendPacket(packet.Write()); TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", quest->GetQuestId());}
开发者ID:TrueWoW,项目名称:TrinityCore,代码行数:101,
示例19: SendQuestGiverOfferRewardvoid PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGuid, bool canComplete, bool closeOnCancel) const{ // We can always call to RequestItems, but this packet only goes out if there are actually // items. Otherwise, we'll skip straight to the OfferReward uint32 itemCounter = quest->GetQuestObjectiveCountType(QUEST_OBJECTIVE_TYPE_ITEM); if (!itemCounter && canComplete) { SendQuestGiverOfferReward(quest, npcGuid, true); return; } std::string questTitle = quest->GetTitle(); std::string requestItemsText = quest->GetRequestItemsText(); int32 locale = _session->GetSessionDbLocaleIndex(); if (locale >= 0) { if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(quest->GetQuestId())) { ObjectMgr::GetLocaleString(localeData->Title, locale, questTitle); ObjectMgr::GetLocaleString(localeData->RequestItemsText, locale, requestItemsText); } } uint32 requiredMoney = 0; ByteBuffer currencyData, itemData; for (QuestObjectiveSet::const_iterator citr = quest->m_questObjectives.begin(); citr != quest->m_questObjectives.end(); citr++) { QuestObjective const* questObjective = *citr; switch (questObjective->Type) { case QUEST_OBJECTIVE_TYPE_ITEM: { if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(questObjective->ObjectId)) itemData << uint32(itemTemplate->DisplayInfoID); else itemData << uint32(0); itemData << uint32(questObjective->ObjectId); itemData << uint32(questObjective->Amount); break; } case QUEST_OBJECTIVE_TYPE_CURRENCY: { currencyData << uint32(questObjective->ObjectId); currencyData << uint32(questObjective->Amount); break; } case QUEST_OBJECTIVE_TYPE_MONEY: { requiredMoney = questObjective->Amount; break; } default: break; } } if (sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS)) AddQuestLevelToTitle(questTitle, quest->GetQuestLevel()); ObjectGuid guid = npcGuid; uint32 currencyCounter = quest->GetQuestObjectiveCountType(QUEST_OBJECTIVE_TYPE_CURRENCY); WorldPacket data(SMSG_QUESTGIVER_REQUEST_ITEMS, 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 1 + 8 + 8 + questTitle.size() + requestItemsText.size() + itemCounter * (4 + 4 + 4) + currencyCounter * (4 + 4)); data << uint32(0); data << uint32(quest->GetFlags()); data << uint32(0); data << uint32(canComplete ? 0x5F : 0x5B); // status flags data << uint32(requiredMoney); data << uint32(0); // quest starter NPC/GO entry data << uint32(0); data << uint32(canComplete ? quest->GetCompleteEmote() : quest->GetIncompleteEmote()); data << uint32(quest->GetQuestId()); /* * TODO: Quest System * * Finish structure, missing values: * Flags2, SuggestPartyMembers, EmoteDelay * * Research StatusFlags: * 0x5B = 0x01 + 0x02 + 0x08 + 0x10 + 0x40 * 0x5F = 0x01 + 0x02 + 0x04 + 0x08 + 0x10 + 0x40 */ data.WriteBits(currencyCounter, 21); data.WriteBit(closeOnCancel); data.WriteBit(guid[2]); data.WriteBit(guid[5]); data.WriteBit(guid[1]); data.WriteBits(questTitle.size(), 9); data.WriteBits(requestItemsText.size(), 12); data.WriteBit(guid[6]);//.........这里部分代码省略.........
开发者ID:Ayik0,项目名称:DeathCore_5.4.8,代码行数:101,
示例20: SendQuestGiverOfferRewardvoid PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, bool canComplete, bool closeOnCancel) const{ // We can always call to RequestItems, but this packet only goes out if there are actually // items. Otherwise, we'll skip straight to the OfferReward std::string questTitle = quest->GetTitle(); std::string requestItemsText = quest->GetRequestItemsText(); int32 locale = _session->GetSessionDbLocaleIndex(); if (locale >= 0) { if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(quest->GetQuestId())) { ObjectMgr::GetLocaleString(localeData->Title, locale, questTitle); ObjectMgr::GetLocaleString(localeData->RequestItemsText, locale, requestItemsText); } } if (!quest->GetReqItemsCount() && canComplete) { SendQuestGiverOfferReward(quest, npcGUID, true); return; } if (sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS)) AddQuestLevelToTitle(questTitle, quest->GetQuestLevel()); WorldPacket data(SMSG_QUESTGIVER_REQUEST_ITEMS, 50); // guess size data << uint64(npcGUID); data << uint32(quest->GetQuestId()); data << questTitle; data << requestItemsText; data << uint32(0); // unknown if (canComplete) data << quest->GetCompleteEmote(); else data << quest->GetIncompleteEmote(); // Close Window after cancel data << uint32(closeOnCancel); data << uint32(quest->GetFlags()); // 3.3.3 questFlags data << uint32(quest->GetSuggestedPlayers()); // SuggestedGroupNum // Required Money data << uint32(quest->GetRewOrReqMoney() < 0 ? -quest->GetRewOrReqMoney() : 0); data << uint32(quest->GetReqItemsCount()); for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { if (!quest->RequiredItemId[i]) continue; data << uint32(quest->RequiredItemId[i]); data << uint32(quest->RequiredItemCount[i]); if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RequiredItemId[i])) data << uint32(itemTemplate->DisplayInfoID); else data << uint32(0); } data << uint32(quest->GetReqCurrencyCount()); for (int i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i) { if (!quest->RequiredCurrencyId[i]) continue; data << uint32(quest->RequiredCurrencyId[i]); data << uint32(quest->RequiredCurrencyCount[i]); } if (!canComplete) // Experimental; there are 6 similar flags, if any of them data << uint32(0x00); // of them is 0 player can't complete quest (still unknown meaning) else data << uint32(0x02); data << uint32(0x04); data << uint32(0x08); data << uint32(0x10); data << uint32(0x40); _session->SendPacket(&data); TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId());}
开发者ID:Walkum,项目名称:SkyFire_5xx,代码行数:87,
注:本文中的AddQuestLevelToTitle函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AddRef函数代码示例 C++ AddProperty函数代码示例 |