mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 00:58:33 +00:00
Auto do quest feature (new rpg strategy) (#1034)
* New rpg startup speed up and refactor * New rpg do quest * Fix invalid height in quest poi * Add quest accept and reward limitation * New rpg quest improvement * Organize quest log, reward quests and fix grind target * Quest dropped statistic and remove redundant code * Decrease grind relevance lower than loot * Fix new rpg drop quest * Go to reward quest instead of innkeeper when quest completed * Fix incorrect logic in do quest reward * Fix reset quests in factory * Fix crash on grind target value Co-authored-by: SaW <swerkhoven@outlook.com> * Fix a minor error in DoCompletedQuest * Let bots get rid of impossible quests faster * Increase loot fluency (especially for caster) * Remove seasonal quests from auto accept * Enhance quest accept condition check * Add questgiver check (limit acceptation of quest 7946) * Questgiver check and localization * Near npc fix * Fix quest item report * Add lowPriorityQuest set for quests can not be done * Improve gameobjects loot * Do complete quest * FIx move far to teleport check * Accept or reward quest from game objects * Fix possible crash in rpg game objects * Fix ChooseNpcOrGameObjectToInteract crash --------- Co-authored-by: SaW <swerkhoven@outlook.com>
This commit is contained in:
@@ -14,10 +14,13 @@
|
||||
#include "BudgetValues.h"
|
||||
#include "ChannelMgr.h"
|
||||
#include "CharacterPackets.h"
|
||||
#include "Common.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "CreatureData.h"
|
||||
#include "EmoteAction.h"
|
||||
#include "Engine.h"
|
||||
#include "ExternalEventHelper.h"
|
||||
#include "GameObjectData.h"
|
||||
#include "GameTime.h"
|
||||
#include "GuildMgr.h"
|
||||
#include "GuildTaskMgr.h"
|
||||
@@ -32,6 +35,7 @@
|
||||
#include "MoveSplineInit.h"
|
||||
#include "NewRpgStrategy.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PerformanceMonitor.h"
|
||||
#include "Player.h"
|
||||
#include "PlayerbotAIConfig.h"
|
||||
@@ -204,7 +208,7 @@ PlayerbotAI::PlayerbotAI(Player* bot)
|
||||
masterIncomingPacketHandlers.AddHandler(CMSG_PUSHQUESTTOPARTY, "quest share");
|
||||
botOutgoingPacketHandlers.AddHandler(SMSG_QUESTUPDATE_COMPLETE, "quest update complete");
|
||||
botOutgoingPacketHandlers.AddHandler(SMSG_QUESTUPDATE_ADD_KILL, "quest update add kill");
|
||||
botOutgoingPacketHandlers.AddHandler(SMSG_QUESTUPDATE_ADD_ITEM, "quest update add item");
|
||||
// botOutgoingPacketHandlers.AddHandler(SMSG_QUESTUPDATE_ADD_ITEM, "quest update add item"); // SMSG_QUESTUPDATE_ADD_ITEM no longer used
|
||||
botOutgoingPacketHandlers.AddHandler(SMSG_QUEST_CONFIRM_ACCEPT, "confirm quest");
|
||||
}
|
||||
|
||||
@@ -2287,10 +2291,46 @@ const AreaTableEntry* PlayerbotAI::GetCurrentZone()
|
||||
|
||||
std::string PlayerbotAI::GetLocalizedAreaName(const AreaTableEntry* entry)
|
||||
{
|
||||
std::string name;
|
||||
if (entry)
|
||||
return entry->area_name[sWorld->GetDefaultDbcLocale()];
|
||||
{
|
||||
name = entry->area_name[sWorld->GetDefaultDbcLocale()];
|
||||
if (name.empty())
|
||||
name = entry->area_name[LOCALE_enUS];
|
||||
}
|
||||
|
||||
return "";
|
||||
return name;
|
||||
}
|
||||
|
||||
std::string PlayerbotAI::GetLocalizedCreatureName(uint32 entry)
|
||||
{
|
||||
std::string name;
|
||||
const CreatureLocale* cl = sObjectMgr->GetCreatureLocale(entry);
|
||||
if (cl)
|
||||
ObjectMgr::GetLocaleString(cl->Name, sWorld->GetDefaultDbcLocale(), name);
|
||||
if (name.empty())
|
||||
{
|
||||
CreatureTemplate const* ct = sObjectMgr->GetCreatureTemplate(entry);
|
||||
if (ct)
|
||||
name = ct->Name;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
std::string PlayerbotAI::GetLocalizedGameObjectName(uint32 entry)
|
||||
{
|
||||
std::string name;
|
||||
const GameObjectLocale* gl = sObjectMgr->GetGameObjectLocale(entry);
|
||||
if (gl)
|
||||
ObjectMgr::GetLocaleString(gl->Name, sWorld->GetDefaultDbcLocale(), name);
|
||||
if (name.empty())
|
||||
{
|
||||
GameObjectTemplate const* gt = sObjectMgr->GetGameObjectTemplate(entry);
|
||||
if (gt)
|
||||
name = gt->name;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
std::vector<Player*> PlayerbotAI::GetPlayersInGroup()
|
||||
|
||||
Reference in New Issue
Block a user