mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-13 02:38:45 +00:00
Merge branch 'master' into kinglykrab/databaseupdate-global-to-singleton
This commit is contained in:
+255
-61
@@ -12,7 +12,6 @@ SET(zone_sources
|
||||
bonuses.cpp
|
||||
bot.cpp
|
||||
bot_raid.cpp
|
||||
bot_command.cpp
|
||||
bot_database.cpp
|
||||
botspellsai.cpp
|
||||
cheat_manager.cpp
|
||||
@@ -23,7 +22,6 @@ SET(zone_sources
|
||||
client_packet.cpp
|
||||
client_process.cpp
|
||||
combat_record.cpp
|
||||
command.cpp
|
||||
corpse.cpp
|
||||
../common/data_bucket.cpp
|
||||
doors.cpp
|
||||
@@ -48,36 +46,6 @@ SET(zone_sources
|
||||
horse.cpp
|
||||
inventory.cpp
|
||||
loot.cpp
|
||||
lua_bot.cpp
|
||||
lua_bit.cpp
|
||||
lua_buff.cpp
|
||||
lua_corpse.cpp
|
||||
lua_client.cpp
|
||||
lua_database.cpp
|
||||
lua_door.cpp
|
||||
lua_encounter.cpp
|
||||
lua_entity.cpp
|
||||
lua_entity_list.cpp
|
||||
lua_expedition.cpp
|
||||
lua_general.cpp
|
||||
lua_group.cpp
|
||||
lua_hate_list.cpp
|
||||
lua_inventory.cpp
|
||||
lua_item.cpp
|
||||
lua_iteminst.cpp
|
||||
lua_merc.cpp
|
||||
lua_mob.cpp
|
||||
lua_mod.cpp
|
||||
lua_npc.cpp
|
||||
lua_object.cpp
|
||||
lua_packet.cpp
|
||||
lua_parser.cpp
|
||||
lua_parser_events.cpp
|
||||
lua_raid.cpp
|
||||
lua_spawn.cpp
|
||||
lua_spell.cpp
|
||||
lua_stat_bonuses.cpp
|
||||
lua_zone.cpp
|
||||
embperl.cpp
|
||||
entity.cpp
|
||||
exp.cpp
|
||||
@@ -108,30 +76,6 @@ SET(zone_sources
|
||||
pathfinder_nav_mesh.cpp
|
||||
pathfinder_null.cpp
|
||||
pathing.cpp
|
||||
perl_bot.cpp
|
||||
perl_buff.cpp
|
||||
perl_client.cpp
|
||||
perl_database.cpp
|
||||
perl_doors.cpp
|
||||
perl_entity.cpp
|
||||
perl_expedition.cpp
|
||||
perl_groups.cpp
|
||||
perl_hateentry.cpp
|
||||
perl_inventory.cpp
|
||||
perl_merc.cpp
|
||||
perl_mob.cpp
|
||||
perl_npc.cpp
|
||||
perl_object.cpp
|
||||
perl_perlpacket.cpp
|
||||
perl_player_corpse.cpp
|
||||
perl_questitem.cpp
|
||||
perl_questitem_data.cpp
|
||||
perl_raids.cpp
|
||||
perl_spawn.cpp
|
||||
perl_spell.cpp
|
||||
perl_stat_bonuses.cpp
|
||||
perl_zone.cpp
|
||||
perlpacket.cpp
|
||||
petitions.cpp
|
||||
pets.cpp
|
||||
position.cpp
|
||||
@@ -296,18 +240,268 @@ SET(zone_headers
|
||||
zone_save_state.h
|
||||
zone_cli.cpp)
|
||||
|
||||
# lua unity build
|
||||
set(lua_sources
|
||||
lua_bot.cpp
|
||||
lua_bit.cpp
|
||||
lua_buff.cpp
|
||||
lua_corpse.cpp
|
||||
lua_client.cpp
|
||||
lua_database.cpp
|
||||
lua_door.cpp
|
||||
lua_encounter.cpp
|
||||
lua_entity.cpp
|
||||
lua_entity_list.cpp
|
||||
lua_expedition.cpp
|
||||
lua_general.cpp
|
||||
lua_group.cpp
|
||||
lua_hate_list.cpp
|
||||
lua_inventory.cpp
|
||||
lua_item.cpp
|
||||
lua_iteminst.cpp
|
||||
lua_merc.cpp
|
||||
lua_mob.cpp
|
||||
lua_mod.cpp
|
||||
lua_npc.cpp
|
||||
lua_object.cpp
|
||||
lua_packet.cpp
|
||||
lua_parser.cpp
|
||||
lua_parser_events.cpp
|
||||
lua_raid.cpp
|
||||
lua_spawn.cpp
|
||||
lua_spell.cpp
|
||||
lua_stat_bonuses.cpp
|
||||
lua_zone.cpp
|
||||
)
|
||||
|
||||
add_library(lua_zone STATIC ${lua_sources})
|
||||
set_target_properties(lua_zone PROPERTIES UNITY_BUILD ON UNITY_BUILD_BATCH_SIZE 8)
|
||||
|
||||
# perl unity build
|
||||
set(perl_sources
|
||||
perl_bot.cpp
|
||||
perl_buff.cpp
|
||||
perl_client.cpp
|
||||
perl_database.cpp
|
||||
perl_doors.cpp
|
||||
perl_entity.cpp
|
||||
perl_expedition.cpp
|
||||
perl_groups.cpp
|
||||
perl_hateentry.cpp
|
||||
perl_inventory.cpp
|
||||
perl_merc.cpp
|
||||
perl_mob.cpp
|
||||
perl_npc.cpp
|
||||
perl_object.cpp
|
||||
perl_perlpacket.cpp
|
||||
perl_player_corpse.cpp
|
||||
perl_questitem.cpp
|
||||
perl_questitem_data.cpp
|
||||
perl_raids.cpp
|
||||
perl_spawn.cpp
|
||||
perl_spell.cpp
|
||||
perl_stat_bonuses.cpp
|
||||
perl_zone.cpp
|
||||
perlpacket.cpp
|
||||
)
|
||||
|
||||
add_library(perl_zone STATIC ${perl_sources})
|
||||
set_target_properties(perl_zone PROPERTIES UNITY_BUILD ON UNITY_BUILD_BATCH_SIZE 8)
|
||||
|
||||
# gm commands
|
||||
set(gm_command_sources
|
||||
command.cpp
|
||||
bot_command.cpp
|
||||
gm_commands/acceptrules.cpp
|
||||
gm_commands/advnpcspawn.cpp
|
||||
gm_commands/aggrozone.cpp
|
||||
gm_commands/ai.cpp
|
||||
gm_commands/appearance.cpp
|
||||
gm_commands/appearanceeffects.cpp
|
||||
gm_commands/attack.cpp
|
||||
gm_commands/augmentitem.cpp
|
||||
gm_commands/ban.cpp
|
||||
gm_commands/bugs.cpp
|
||||
gm_commands/camerashake.cpp
|
||||
gm_commands/castspell.cpp
|
||||
gm_commands/chat.cpp
|
||||
gm_commands/clearxtargets.cpp
|
||||
gm_commands/copycharacter.cpp
|
||||
gm_commands/corpse.cpp
|
||||
gm_commands/corpsefix.cpp
|
||||
gm_commands/countitem.cpp
|
||||
gm_commands/damage.cpp
|
||||
gm_commands/databuckets.cpp
|
||||
gm_commands/dbspawn2.cpp
|
||||
gm_commands/delacct.cpp
|
||||
gm_commands/delpetition.cpp
|
||||
gm_commands/depop.cpp
|
||||
gm_commands/depopzone.cpp
|
||||
gm_commands/devtools.cpp
|
||||
gm_commands/disablerecipe.cpp
|
||||
gm_commands/disarmtrap.cpp
|
||||
gm_commands/doanim.cpp
|
||||
gm_commands/door.cpp
|
||||
gm_commands/door_manipulation.cpp
|
||||
gm_commands/dye.cpp
|
||||
gm_commands/dz.cpp
|
||||
gm_commands/dzkickplayers.cpp
|
||||
gm_commands/editmassrespawn.cpp
|
||||
gm_commands/emote.cpp
|
||||
gm_commands/emptyinventory.cpp
|
||||
gm_commands/enablerecipe.cpp
|
||||
gm_commands/entityvariable.cpp
|
||||
gm_commands/exptoggle.cpp
|
||||
gm_commands/faction.cpp
|
||||
gm_commands/evolving_items.cpp
|
||||
gm_commands/feature.cpp
|
||||
gm_commands/find.cpp
|
||||
gm_commands/fish.cpp
|
||||
gm_commands/fixmob.cpp
|
||||
gm_commands/flagedit.cpp
|
||||
gm_commands/fleeinfo.cpp
|
||||
gm_commands/forage.cpp
|
||||
gm_commands/gearup.cpp
|
||||
gm_commands/giveitem.cpp
|
||||
gm_commands/givemoney.cpp
|
||||
gm_commands/gmzone.cpp
|
||||
gm_commands/goto.cpp
|
||||
gm_commands/grantaa.cpp
|
||||
gm_commands/grid.cpp
|
||||
gm_commands/guild.cpp
|
||||
gm_commands/hp.cpp
|
||||
gm_commands/illusion_block.cpp
|
||||
gm_commands/instance.cpp
|
||||
gm_commands/interrogateinv.cpp
|
||||
gm_commands/interrupt.cpp
|
||||
gm_commands/invsnapshot.cpp
|
||||
gm_commands/ipban.cpp
|
||||
gm_commands/kick.cpp
|
||||
gm_commands/kill.cpp
|
||||
gm_commands/killallnpcs.cpp
|
||||
gm_commands/list.cpp
|
||||
gm_commands/lootsim.cpp
|
||||
gm_commands/loc.cpp
|
||||
gm_commands/logs.cpp
|
||||
gm_commands/makepet.cpp
|
||||
gm_commands/memspell.cpp
|
||||
gm_commands/merchantshop.cpp
|
||||
gm_commands/modifynpcstat.cpp
|
||||
gm_commands/movechar.cpp
|
||||
gm_commands/movement.cpp
|
||||
gm_commands/myskills.cpp
|
||||
gm_commands/mysql.cpp
|
||||
gm_commands/mystats.cpp
|
||||
gm_commands/npccast.cpp
|
||||
gm_commands/npcedit.cpp
|
||||
gm_commands/npceditmass.cpp
|
||||
gm_commands/npcemote.cpp
|
||||
gm_commands/npcloot.cpp
|
||||
gm_commands/npcsay.cpp
|
||||
gm_commands/npcshout.cpp
|
||||
gm_commands/npcspawn.cpp
|
||||
gm_commands/npctypespawn.cpp
|
||||
gm_commands/nudge.cpp
|
||||
gm_commands/nukebuffs.cpp
|
||||
gm_commands/nukeitem.cpp
|
||||
gm_commands/object.cpp
|
||||
gm_commands/object_manipulation.cpp
|
||||
gm_commands/parcels.cpp
|
||||
gm_commands/path.cpp
|
||||
gm_commands/peqzone.cpp
|
||||
gm_commands/petitems.cpp
|
||||
gm_commands/petname.cpp
|
||||
gm_commands/picklock.cpp
|
||||
gm_commands/profanity.cpp
|
||||
gm_commands/push.cpp
|
||||
gm_commands/raidloot.cpp
|
||||
gm_commands/randomfeatures.cpp
|
||||
gm_commands/refreshgroup.cpp
|
||||
gm_commands/reload.cpp
|
||||
gm_commands/removeitem.cpp
|
||||
gm_commands/repop.cpp
|
||||
gm_commands/resetaa.cpp
|
||||
gm_commands/resetaa_timer.cpp
|
||||
gm_commands/resetdisc_timer.cpp
|
||||
gm_commands/revoke.cpp
|
||||
gm_commands/roambox.cpp
|
||||
gm_commands/rules.cpp
|
||||
gm_commands/save.cpp
|
||||
gm_commands/scale.cpp
|
||||
gm_commands/scribespell.cpp
|
||||
gm_commands/scribespells.cpp
|
||||
gm_commands/sendzonespawns.cpp
|
||||
gm_commands/sensetrap.cpp
|
||||
gm_commands/serverrules.cpp
|
||||
gm_commands/set.cpp
|
||||
gm_commands/show.cpp
|
||||
gm_commands/shutdown.cpp
|
||||
gm_commands/spawn.cpp
|
||||
gm_commands/spawneditmass.cpp
|
||||
gm_commands/spawnfix.cpp
|
||||
gm_commands/faction_association.cpp
|
||||
gm_commands/stun.cpp
|
||||
gm_commands/summon.cpp
|
||||
gm_commands/summonburiedplayercorpse.cpp
|
||||
gm_commands/summonitem.cpp
|
||||
gm_commands/suspend.cpp
|
||||
gm_commands/suspendmulti.cpp
|
||||
gm_commands/takeplatinum.cpp
|
||||
gm_commands/task.cpp
|
||||
gm_commands/traindisc.cpp
|
||||
gm_commands/tune.cpp
|
||||
gm_commands/undye.cpp
|
||||
gm_commands/unmemspell.cpp
|
||||
gm_commands/unmemspells.cpp
|
||||
gm_commands/unscribespell.cpp
|
||||
gm_commands/unscribespells.cpp
|
||||
gm_commands/untraindisc.cpp
|
||||
gm_commands/untraindiscs.cpp
|
||||
gm_commands/wc.cpp
|
||||
gm_commands/worldshutdown.cpp
|
||||
gm_commands/worldwide.cpp
|
||||
gm_commands/wp.cpp
|
||||
gm_commands/wpadd.cpp
|
||||
gm_commands/zone.cpp
|
||||
gm_commands/zonebootup.cpp
|
||||
gm_commands/zoneshutdown.cpp
|
||||
gm_commands/zonevariable.cpp
|
||||
gm_commands/zone_instance.cpp
|
||||
gm_commands/zone_shard.cpp
|
||||
gm_commands/zsave.cpp
|
||||
)
|
||||
|
||||
add_library(gm_commands_zone STATIC ${gm_command_sources})
|
||||
set_target_properties(gm_commands_zone PROPERTIES UNITY_BUILD ON UNITY_BUILD_BATCH_SIZE 32)
|
||||
|
||||
# zone combine sources and headers
|
||||
ADD_EXECUTABLE(zone ${zone_sources} ${zone_headers})
|
||||
|
||||
# binary output directory
|
||||
INSTALL(TARGETS zone RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
|
||||
IF (WIN32 AND EQEMU_BUILD_PCH)
|
||||
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ../common/pch/pch.h)
|
||||
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ../common/types.h ../common/eqemu_logsys.h ../common/eqemu_logsys_log_aliases.h ../common/features.h ../common/global_define.h)
|
||||
TARGET_PRECOMPILE_HEADERS(zone PRIVATE mob.h npc.h corpse.h doors.h bot.h entity.h client.h zone.h)
|
||||
# precompiled headers
|
||||
IF (EQEMU_BUILD_PCH)
|
||||
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ../common/pch/app-pch.h)
|
||||
TARGET_PRECOMPILE_HEADERS(zone PRIVATE ./pch/pch.h)
|
||||
ENDIF()
|
||||
|
||||
ADD_DEFINITIONS(-DZONE)
|
||||
|
||||
TARGET_LINK_LIBRARIES(zone ${ZONE_LIBS})
|
||||
# link lua_zone unity build against luabind
|
||||
target_link_libraries(lua_zone PRIVATE luabind)
|
||||
if (EQEMU_BUILD_STATIC AND LUA_LIBRARY)
|
||||
target_link_libraries(zone PRIVATE ${LUA_LIBRARY})
|
||||
endif()
|
||||
|
||||
# perl unity build links against perl_zone
|
||||
target_link_libraries(perl_zone PRIVATE perlbind)
|
||||
if (EQEMU_BUILD_STATIC AND PERL_LIBRARY)
|
||||
target_link_libraries(zone PRIVATE ${PERL_LIBRARY})
|
||||
endif()
|
||||
|
||||
# link zone against common libraries
|
||||
target_link_libraries(zone PRIVATE ${ZONE_LIBS} lua_zone perl_zone gm_commands_zone)
|
||||
|
||||
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
||||
|
||||
|
||||
+1
-1
@@ -2683,7 +2683,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
give_exp_client->GetCleanName(),
|
||||
GetNPCTypeID()
|
||||
);
|
||||
task_manager->HandleUpdateTasksOnKill(give_exp_client, this);
|
||||
TaskManager::Instance()->HandleUpdateTasksOnKill(give_exp_client, this);
|
||||
}
|
||||
|
||||
if (killer_raid) {
|
||||
|
||||
+5
-5
@@ -1242,7 +1242,7 @@ uint16 Bot::GetPrimarySkillValue() {
|
||||
}
|
||||
|
||||
uint16 Bot::MaxSkill(EQ::skills::SkillType skillid, uint16 class_, uint16 level) const {
|
||||
return skill_caps.GetSkillCap(class_, skillid, level).cap;
|
||||
return SkillCaps::Instance()->GetSkillCap(class_, skillid, level).cap;
|
||||
}
|
||||
|
||||
uint32 Bot::GetTotalATK() {
|
||||
@@ -3575,7 +3575,7 @@ void Bot::Depop() {
|
||||
RemoveAllAuras();
|
||||
|
||||
Mob* bot_pet = GetPet();
|
||||
|
||||
|
||||
if (bot_pet) {
|
||||
if (bot_pet->Charmed()) {
|
||||
bot_pet->BuffFadeByEffect(SE_Charm);
|
||||
@@ -7342,7 +7342,7 @@ void Bot::CalcBotStats(bool showtext) {
|
||||
SetLevel(GetBotOwner()->GetLevel());
|
||||
|
||||
for (int sindex = 0; sindex <= EQ::skills::HIGHEST_SKILL; ++sindex) {
|
||||
skills[sindex] = skill_caps.GetSkillCap(GetClass(), (EQ::skills::SkillType)sindex, GetLevel()).cap;
|
||||
skills[sindex] = SkillCaps::Instance()->GetSkillCap(GetClass(), (EQ::skills::SkillType)sindex, GetLevel()).cap;
|
||||
}
|
||||
|
||||
taunt_timer.Start(1000);
|
||||
@@ -11274,7 +11274,7 @@ void Bot::SetSpellTypePriority(uint16 spell_type, uint8 priority_type, uint16 pr
|
||||
|
||||
std::list<BotSpellTypeOrder> Bot::GetSpellTypesPrioritized(uint8 priority_type) {
|
||||
std::list<BotSpellTypeOrder> cast_order;
|
||||
|
||||
|
||||
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; i++) {
|
||||
BotSpellTypeOrder typeSettings = {
|
||||
.spellType = i,
|
||||
@@ -13463,4 +13463,4 @@ bool Bot::HasControllablePet(uint8 ranks_required) {
|
||||
return GetClass() != Class::Enchanter ||
|
||||
GetPet()->GetPetType() != petAnimation ||
|
||||
GetAA(aaAnimationEmpathy) >= ranks_required;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,6 @@
|
||||
|
||||
extern QueryServ* QServ;
|
||||
extern WorldServer worldserver;
|
||||
extern TaskManager *task_manager;
|
||||
|
||||
int bot_command_count;
|
||||
|
||||
@@ -165,7 +164,7 @@ int bot_command_init(void)
|
||||
bot_command_add("inventoryremove", "Removes an item from a bot's inventory", AccountStatus::Player, bot_command_inventory_remove) ||
|
||||
bot_command_add("inventorywindow", "Displays all items in a bot's inventory in a pop-up window", AccountStatus::Player, bot_command_inventory_window) ||
|
||||
bot_command_add("itemuse", "Elicits a report from spawned bots that can use the item on your cursor (option 'empty' yields only empty slots)", AccountStatus::Player, bot_command_item_use) ||
|
||||
bot_command_add("maxmeleerange", "Toggles whether your bot is at max melee range or not. This will disable all special abilities, including taunt.", AccountStatus::Player, bot_command_max_melee_range) ||
|
||||
bot_command_add("maxmeleerange", "Toggles whether your bot is at max melee range or not. This will disable all special abilities, including taunt.", AccountStatus::Player, bot_command_max_melee_range) ||
|
||||
bot_command_add("owneroption", "Sets options available to bot owners", AccountStatus::Player, bot_command_owner_option) ||
|
||||
bot_command_add("pet", "Lists the available bot pet [subcommands]", AccountStatus::Player, bot_command_pet) ||
|
||||
bot_command_add("petgetlost", "Orders a bot to remove its summoned pet", AccountStatus::Player, bot_command_pet_get_lost) ||
|
||||
@@ -189,11 +188,11 @@ int bot_command_init(void)
|
||||
bot_command_add("spellmaxhppct", "Controls at what HP percent a bot will stop casting different spell types", AccountStatus::Player, bot_command_spell_max_hp_pct) ||
|
||||
bot_command_add("spellmaxmanapct", "Controls at what mana percent a bot will stop casting different spell types", AccountStatus::Player, bot_command_spell_max_mana_pct) ||
|
||||
bot_command_add("spellmaxthresholds", "Controls the minimum target HP threshold for a spell to be cast for a specific type", AccountStatus::Player, bot_command_spell_max_thresholds) ||
|
||||
bot_command_add("spellminhppct", "Controls at what HP percent a bot will start casting different spell types", AccountStatus::Player, bot_command_spell_min_hp_pct) ||
|
||||
bot_command_add("spellminhppct", "Controls at what HP percent a bot will start casting different spell types", AccountStatus::Player, bot_command_spell_min_hp_pct) ||
|
||||
bot_command_add("spellminmanapct", "Controls at what mana percent a bot will start casting different spell types", AccountStatus::Player, bot_command_spell_min_mana_pct) ||
|
||||
bot_command_add("spellminthresholds", "Controls the maximum target HP threshold for a spell to be cast for a specific type", AccountStatus::Player, bot_command_spell_min_thresholds) ||
|
||||
bot_command_add("spellminthresholds", "Controls the maximum target HP threshold for a spell to be cast for a specific type", AccountStatus::Player, bot_command_spell_min_thresholds) ||
|
||||
bot_command_add("spellresistlimits", "Controls the resist limits for bots to cast spells on their target", AccountStatus::Player, bot_command_spell_resist_limits) ||
|
||||
bot_command_add("spellpursuepriority", "Controls the order of casts by spell type when pursuing in combat", AccountStatus::Player, bot_command_spell_pursue_priority) ||
|
||||
bot_command_add("spellpursuepriority", "Controls the order of casts by spell type when pursuing in combat", AccountStatus::Player, bot_command_spell_pursue_priority) ||
|
||||
bot_command_add("spelltargetcount", "Sets the required target amount for group/AE spells by spell type", AccountStatus::Player, bot_command_spell_target_count) ||
|
||||
bot_command_add("spellinfo", "Opens a dialogue window with spell info", AccountStatus::Player, bot_spell_info_dialogue_window) ||
|
||||
bot_command_add("spells", "Lists all Spells learned by the Bot.", AccountStatus::Player, bot_command_spell_list) ||
|
||||
|
||||
+55
-7
@@ -74,13 +74,61 @@ bool BotDatabase::LoadBotCommandSettings(std::map<std::string, std::pair<uint8,
|
||||
return true;
|
||||
}
|
||||
|
||||
template<typename T1, typename T2>
|
||||
inline std::vector<std::string> join_pair(
|
||||
const std::string &glue,
|
||||
const std::pair<char, char> &encapsulation,
|
||||
const std::vector<std::pair<T1, T2>> &src
|
||||
)
|
||||
{
|
||||
if (src.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<std::string> output;
|
||||
|
||||
for (const std::pair<T1, T2> &src_iter: src) {
|
||||
output.emplace_back(
|
||||
|
||||
fmt::format(
|
||||
"{}{}{}{}{}{}{}",
|
||||
encapsulation.first,
|
||||
src_iter.first,
|
||||
encapsulation.second,
|
||||
glue,
|
||||
encapsulation.first,
|
||||
src_iter.second,
|
||||
encapsulation.second
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline std::string
|
||||
ImplodePair(const std::string &glue, const std::pair<char, char> &encapsulation, const std::vector<T> &src)
|
||||
{
|
||||
if (src.empty()) {
|
||||
return {};
|
||||
}
|
||||
std::ostringstream oss;
|
||||
for (const T &src_iter: src) {
|
||||
oss << encapsulation.first << src_iter << encapsulation.second << glue;
|
||||
}
|
||||
std::string output(oss.str());
|
||||
output.resize(output.size() - glue.size());
|
||||
return output;
|
||||
}
|
||||
|
||||
bool BotDatabase::UpdateInjectedBotCommandSettings(const std::vector<std::pair<std::string, uint8>> &injected)
|
||||
{
|
||||
if (injected.size()) {
|
||||
|
||||
query = fmt::format(
|
||||
"REPLACE INTO `bot_command_settings`(`bot_command`, `access`) VALUES {}",
|
||||
Strings::ImplodePair(
|
||||
ImplodePair(
|
||||
",",
|
||||
std::pair<char, char>('(', ')'),
|
||||
join_pair(",", std::pair<char, char>('\'', '\''), injected)
|
||||
@@ -107,7 +155,7 @@ bool BotDatabase::UpdateOrphanedBotCommandSettings(const std::vector<std::string
|
||||
|
||||
query = fmt::format(
|
||||
"DELETE FROM `bot_command_settings` WHERE `bot_command` IN ({})",
|
||||
Strings::ImplodePair(",", std::pair<char, char>('\'', '\''), orphaned)
|
||||
ImplodePair(",", std::pair<char, char>('\'', '\''), orphaned)
|
||||
);
|
||||
|
||||
if (!database.QueryDatabase(query).Success()) {
|
||||
@@ -248,7 +296,7 @@ bool BotDatabase::LoadBotsList(const uint32 owner_id, std::list<BotsAvailableLis
|
||||
SELECT `account_id` FROM `character_data` WHERE `id` = {}
|
||||
)
|
||||
)
|
||||
AND
|
||||
AND
|
||||
`name` NOT LIKE '%-deleted-%'
|
||||
),
|
||||
owner_id
|
||||
@@ -2226,7 +2274,7 @@ bool BotDatabase::LoadBotSettings(Mob* m)
|
||||
else {
|
||||
query = fmt::format("`bot_id` = {} AND `stance` = {}", mob_id, stance_id);
|
||||
}
|
||||
|
||||
|
||||
if (stance_id == Stance::Passive) {
|
||||
LogBotSettings("{} is currently set to {} [#{}]. No saving or loading required.", m->GetCleanName(), Stance::GetName(Stance::Passive), Stance::Passive);
|
||||
return true;
|
||||
@@ -2278,7 +2326,7 @@ bool BotDatabase::SaveBotSettings(Mob* m)
|
||||
if (!m->IsOfClientBot()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
uint32 bot_id = (m->IsBot() ? m->CastToBot()->GetBotID() : 0);
|
||||
uint32 character_id = (m->IsClient() ? m->CastToClient()->CharacterID() : 0);
|
||||
uint8 stance_id = (m->IsBot() ? m->CastToBot()->GetBotStance() : 0);
|
||||
@@ -2289,10 +2337,10 @@ bool BotDatabase::SaveBotSettings(Mob* m)
|
||||
}
|
||||
|
||||
std::string query = "";
|
||||
|
||||
|
||||
if (m->IsClient()) {
|
||||
query = fmt::format("`character_id` = {} AND `stance` = {}", character_id, stance_id);
|
||||
}
|
||||
}
|
||||
else {
|
||||
query = fmt::format("`bot_id` = {} AND `stance` = {}", bot_id, stance_id);
|
||||
}
|
||||
|
||||
@@ -195,6 +195,25 @@ void RunBenchmarkCycle(uint64_t target_rows)
|
||||
std::cout << "✅ Completed " << Strings::Commify(OPERATIONS_PER_TEST) << " cached reads in "
|
||||
<< read_cached_time.count() << " seconds. (DataBucket::GetData)\n";
|
||||
|
||||
// 🔍 **Measure Client-Scoped Cache Miss Performance (Skips DB via CanCache)**
|
||||
auto read_client_cache_miss_start = std::chrono::high_resolution_clock::now();
|
||||
for (size_t i = 0; i < OPERATIONS_PER_TEST; ++i) {
|
||||
// generate key that doesn't exist
|
||||
std::string key = "nonexistent_key_" + std::to_string(i);
|
||||
|
||||
DataBucketKey k{
|
||||
.key = key,
|
||||
.character_id = 999999999, // use scoped value
|
||||
};
|
||||
|
||||
DataBucket::GetData(k);
|
||||
}
|
||||
auto read_client_cache_miss_end = std::chrono::high_resolution_clock::now();
|
||||
std::chrono::duration<double> read_client_cache_miss_time = read_client_cache_miss_end - read_client_cache_miss_start;
|
||||
std::cout << "✅ Completed " << Strings::Commify(OPERATIONS_PER_TEST)
|
||||
<< " scoped cache-miss reads (no DB) in "
|
||||
<< read_client_cache_miss_time.count() << " seconds. (Client Scoped, Cache Miss, No DB)\n";
|
||||
|
||||
// 🔍 **Measure Non-Cached Read Performance (Direct Query)**
|
||||
auto read_uncached_start = std::chrono::high_resolution_clock::now();
|
||||
for (size_t i = 0; i < OPERATIONS_PER_TEST; ++i) {
|
||||
|
||||
+124
-19
@@ -5,16 +5,16 @@
|
||||
#include "../../client.h"
|
||||
#include "../../common/net/eqstream.h"
|
||||
|
||||
extern Zone *zone;
|
||||
extern Zone* zone;
|
||||
|
||||
void ZoneCLI::TestDataBuckets(int argc, char **argv, argh::parser &cmd, std::string &description)
|
||||
void ZoneCLI::TestDataBuckets(int argc, char** argv, argh::parser& cmd, std::string& description)
|
||||
{
|
||||
if (cmd[{"-h", "--help"}]) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 break_length = 50;
|
||||
int failed_count = 0;
|
||||
int failed_count = 0;
|
||||
|
||||
LogSys.SilenceConsoleLogging();
|
||||
|
||||
@@ -25,14 +25,36 @@ void ZoneCLI::TestDataBuckets(int argc, char **argv, argh::parser &cmd, std::str
|
||||
entity_list.Process();
|
||||
entity_list.MobProcess();
|
||||
|
||||
Client* client = new Client();
|
||||
client->SetCharacterId(1); // Set a dummy character ID for testing
|
||||
|
||||
LogSys.EnableConsoleLogging();
|
||||
|
||||
LogSys.log_settings[Logs::MySQLQuery].is_category_enabled = std::getenv("DEBUG") ? 1 : 0;
|
||||
LogSys.log_settings[Logs::MySQLQuery].log_to_console = std::getenv("DEBUG") ? 3 : 0;
|
||||
|
||||
// 🧹 Delete all test keys before running tests
|
||||
std::vector<std::string> test_keys_to_clear = {
|
||||
"basic_key", "expiring_key", "cache_key", "json_key", "non_existent_key", "simple_key",
|
||||
"nested", "nested.test1", "nested.test2", "nested.test1.a", "nested.test2.a",
|
||||
"exp_test", "cache_test", "full_json", "full_json.key2", "complex", "complex.nested.obj1",
|
||||
"complex.nested.obj2", "plain_string", "json_array", "nested_partial",
|
||||
"nested_override", "empty_json", "json_string", "deep_nested",
|
||||
"nested_expire", "scoped_miss_test", "scoped_nested_miss.key",
|
||||
"cache_miss_overwrite", "missed_nested_set", "account_client_test", "ac_nested.test",
|
||||
"scoped_db_only_key"
|
||||
};
|
||||
|
||||
DataBucketsRepository::DeleteWhere(
|
||||
database,
|
||||
fmt::format("`key` IN ('{}')", Strings::Join(test_keys_to_clear, "','"))
|
||||
);
|
||||
DataBucket::ClearCache();
|
||||
|
||||
std::cout << "===========================================\n";
|
||||
std::cout << "⚙\uFE0F> Running DataBuckets Tests...\n";
|
||||
std::cout << "===========================================\n\n";
|
||||
|
||||
Client *client = new Client();
|
||||
|
||||
// Basic Key-Value Set/Get
|
||||
client->DeleteBucket("basic_key");
|
||||
client->SetBucket("basic_key", "simple_value");
|
||||
@@ -101,7 +123,7 @@ void ZoneCLI::TestDataBuckets(int argc, char **argv, argh::parser &cmd, std::str
|
||||
client->DeleteBucket("nested");
|
||||
client->SetBucket("nested.test1.a", "value1");
|
||||
client->SetBucket("nested.test2.a", "value2");
|
||||
client->SetBucket("nested.test2", "new_value"); // Should be **rejected**
|
||||
client->SetBucket("nested.test2", "new_value"); // Should be **rejected**
|
||||
value = client->GetBucket("nested");
|
||||
RunTest("Prevent Overwriting Objects", R"({"test1":{"a":"value1"},"test2":{"a":"value2"}})", value);
|
||||
|
||||
@@ -160,9 +182,10 @@ void ZoneCLI::TestDataBuckets(int argc, char **argv, argh::parser &cmd, std::str
|
||||
client->DeleteBucket("complex");
|
||||
client->SetBucket("complex.nested.obj1", "data1");
|
||||
client->SetBucket("complex.nested.obj2", "data2");
|
||||
client->DeleteBucket("does_not_exist"); // Should do nothing
|
||||
client->DeleteBucket("does_not_exist"); // Should do nothing
|
||||
value = client->GetBucket("complex");
|
||||
RunTest("Deleting Non-Existent Key Doesn't Break Existing Data", R"({"nested":{"obj1":"data1","obj2":"data2"}})", value);
|
||||
RunTest("Deleting Non-Existent Key Doesn't Break Existing Data", R"({"nested":{"obj1":"data1","obj2":"data2"}})",
|
||||
value);
|
||||
|
||||
// Get nested key value one level up **
|
||||
client->DeleteBucket("complex");
|
||||
@@ -190,12 +213,12 @@ void ZoneCLI::TestDataBuckets(int argc, char **argv, argh::parser &cmd, std::str
|
||||
value = client->GetBucket("json_array");
|
||||
RunTest("Store and Retrieve JSON Array", R"(["item1", "item2"])", value);
|
||||
|
||||
// // Prevent Overwriting Array with Object**
|
||||
// client->DeleteBucket("json_array");
|
||||
// client->SetBucket("json_array", R"(["item1", "item2"])");
|
||||
// client->SetBucket("json_array.item", "new_value"); // Should be rejected
|
||||
// value = client->GetBucket("json_array");
|
||||
// RunTest("Prevent Overwriting Array with Object", R"(["item1", "item2"])", value);
|
||||
// // Prevent Overwriting Array with Object**
|
||||
// client->DeleteBucket("json_array");
|
||||
// client->SetBucket("json_array", R"(["item1", "item2"])");
|
||||
// client->SetBucket("json_array.item", "new_value"); // Should be rejected
|
||||
// value = client->GetBucket("json_array");
|
||||
// RunTest("Prevent Overwriting Array with Object", R"(["item1", "item2"])", value);
|
||||
|
||||
// Retrieve Non-Existent Nested Key**
|
||||
client->DeleteBucket("nested_partial");
|
||||
@@ -235,11 +258,93 @@ void ZoneCLI::TestDataBuckets(int argc, char **argv, argh::parser &cmd, std::str
|
||||
RunTest("Setting a nested key with an expiration protection test", R"({"test":{"test":"shouldnt_expire"}})", value);
|
||||
|
||||
// Delete Deep Nested Key Keeps Parent**
|
||||
// client->DeleteBucket("deep_nested");
|
||||
// client->SetBucket("deep_nested.level1.level2.level3", R"({"key": "value"})");
|
||||
// client->DeleteBucket("deep_nested.level1.level2.level3.key");
|
||||
// value = client->GetBucket("deep_nested.level1.level2.level3");
|
||||
// RunTest("Delete Deep Nested Key Keeps Parent", "{}", value);
|
||||
// client->DeleteBucket("deep_nested");
|
||||
// client->SetBucket("deep_nested.level1.level2.level3", R"({"key": "value"})");
|
||||
// client->DeleteBucket("deep_nested.level1.level2.level3.key");
|
||||
// value = client->GetBucket("deep_nested.level1.level2.level3");
|
||||
// RunTest("Delete Deep Nested Key Keeps Parent", "{}", value);
|
||||
|
||||
// ================================
|
||||
// 🧪 Scoped Cache-Miss Behavior Tests
|
||||
// ================================
|
||||
|
||||
// Ensure a scoped key (character ID) that doesn't exist is not fetched from DB if not in cache
|
||||
client->DeleteBucket("scoped_miss_test"); // Ensure not in DB
|
||||
DataBucket::ClearCache(); // Clear all caches
|
||||
std::string scoped_miss_value = client->GetBucket("scoped_miss_test");
|
||||
RunTest("Scoped Missing Key Returns Empty (Skips DB)", "", scoped_miss_value);
|
||||
|
||||
// Ensure nested scoped key that isn't in cache returns empty immediately
|
||||
client->DeleteBucket("scoped_nested_miss.key");
|
||||
DataBucket::ClearCache(); // Clear cache again
|
||||
std::string scoped_nested_miss = client->GetBucket("scoped_nested_miss.key");
|
||||
RunTest("Nested Scoped Key Miss Returns Empty (Skips DB)", "", scoped_nested_miss);
|
||||
|
||||
// Write to a key that was previously missed (0-id cached miss)
|
||||
client->DeleteBucket("cache_miss_overwrite");
|
||||
DataBucket::ClearCache(); // Ensure clean slate
|
||||
std::string missed_value = client->GetBucket("cache_miss_overwrite");
|
||||
RunTest("Initial Cache Miss Returns Empty", "", missed_value);
|
||||
client->SetBucket("cache_miss_overwrite", "new_value");
|
||||
std::string new_val = client->GetBucket("cache_miss_overwrite");
|
||||
RunTest("Overwrite After Cache Miss Works", "new_value", new_val);
|
||||
|
||||
// Write a nested key that previously missed
|
||||
client->DeleteBucket("missed_nested_set.test");
|
||||
DataBucket::ClearCache();
|
||||
std::string initial = client->GetBucket("missed_nested_set.test");
|
||||
RunTest("Missed Nested Key Returns Empty", "", initial);
|
||||
client->SetBucket("missed_nested_set.test", "set_value");
|
||||
std::string after_write = client->GetBucket("missed_nested_set.test");
|
||||
RunTest("Nested Set After Miss Works", "set_value", after_write);
|
||||
|
||||
// ================================
|
||||
// 🧪 Scoped Cache Preload Tests (Account + Client)
|
||||
// ================================
|
||||
|
||||
// Clear everything for a clean test
|
||||
// Insert directly into the DB without touching cache
|
||||
const std::string scoped_key = "scoped_db_only_key";
|
||||
client->DeleteBucket(scoped_key);
|
||||
DataBucket::ClearCache();
|
||||
|
||||
// ✅ Scoped insert
|
||||
DataBucketsRepository::InsertOne(
|
||||
database, {
|
||||
.key_ = scoped_key,
|
||||
.value = "cached_value",
|
||||
.character_id = client->CharacterID()
|
||||
}
|
||||
);
|
||||
|
||||
// Cold cache test — should return ""
|
||||
std::string cold_value = client->GetBucket(scoped_key);
|
||||
RunTest("Cold Cache Scoped Key Returns Empty (Due to Skip DB)", "", cold_value);
|
||||
|
||||
// ✅ Reload cache
|
||||
client->LoadDataBucketsCache();
|
||||
|
||||
// Cache should now return the value
|
||||
std::string hot_value = client->GetBucket(scoped_key);
|
||||
RunTest("Post-BulkLoad Scoped Key Returns Value", "cached_value", hot_value);
|
||||
|
||||
// Also test nested key after preload
|
||||
client->DeleteBucket("ac_nested.test");
|
||||
client->SetBucket("ac_nested.test", "nested_val");
|
||||
|
||||
// Clear cache, then preload
|
||||
DataBucket::ClearCache();
|
||||
client->LoadDataBucketsCache();
|
||||
|
||||
std::string nested_value = client->GetBucket("ac_nested.test");
|
||||
RunTest("Post-BulkLoad Nested Scoped Key Returns Value", "nested_val", nested_value);
|
||||
|
||||
// Remove and check that cache misses properly again
|
||||
client->DeleteBucket("ac_nested.test");
|
||||
DataBucket::ClearCache();
|
||||
std::string post_delete_check = client->GetBucket("ac_nested.test");
|
||||
RunTest("Post-Delete Nested Scoped Key Returns Empty", "", post_delete_check);
|
||||
|
||||
|
||||
std::cout << "\n===========================================\n";
|
||||
std::cout << "✅ All DataBucket Tests Completed!\n";
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include "../../common/http/httplib.h"
|
||||
#include "../../common/eqemu_logsys.h"
|
||||
#include "../../common/platform.h"
|
||||
#include "../../zone.h"
|
||||
|
||||
+20
-6
@@ -68,6 +68,7 @@ extern volatile bool RunLoops;
|
||||
#include "../common/repositories/character_disciplines_repository.h"
|
||||
#include "../common/repositories/character_data_repository.h"
|
||||
#include "../common/repositories/character_pet_name_repository.h"
|
||||
#include "../common/repositories/completed_tasks_repository.h"
|
||||
#include "../common/repositories/discovered_items_repository.h"
|
||||
#include "../common/repositories/inventory_repository.h"
|
||||
#include "../common/repositories/keyring_repository.h"
|
||||
@@ -85,7 +86,6 @@ extern Zone* zone;
|
||||
extern volatile bool is_zone_loaded;
|
||||
extern WorldServer worldserver;
|
||||
extern uint32 numclients;
|
||||
extern PetitionList petition_list;
|
||||
|
||||
void UpdateWindowTitle(char* iNewTitle);
|
||||
|
||||
@@ -2232,7 +2232,7 @@ void Client::UpdateAdmin(bool from_database) {
|
||||
|
||||
if (m_pp.gm) {
|
||||
LogInfo("[{}] - [{}] is a GM", __FUNCTION__ , GetName());
|
||||
petition_list.UpdateGMQueue();
|
||||
PetitionList::Instance()->UpdateGMQueue();
|
||||
}
|
||||
|
||||
UpdateWho();
|
||||
@@ -3196,7 +3196,7 @@ bool Client::CanHaveSkill(EQ::skills::SkillType skill_id) const
|
||||
skill_id = EQ::skills::Skill2HPiercing;
|
||||
}
|
||||
|
||||
return skill_caps.GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)).cap > 0;
|
||||
return SkillCaps::Instance()->GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)).cap > 0;
|
||||
}
|
||||
|
||||
uint16 Client::MaxSkill(EQ::skills::SkillType skill_id, uint8 class_id, uint8 level) const
|
||||
@@ -3209,7 +3209,7 @@ uint16 Client::MaxSkill(EQ::skills::SkillType skill_id, uint8 class_id, uint8 le
|
||||
skill_id = EQ::skills::Skill2HPiercing;
|
||||
}
|
||||
|
||||
return skill_caps.GetSkillCap(class_id, skill_id, level).cap;
|
||||
return SkillCaps::Instance()->GetSkillCap(class_id, skill_id, level).cap;
|
||||
}
|
||||
|
||||
uint8 Client::GetSkillTrainLevel(EQ::skills::SkillType skill_id, uint8 class_id)
|
||||
@@ -3222,7 +3222,7 @@ uint8 Client::GetSkillTrainLevel(EQ::skills::SkillType skill_id, uint8 class_id)
|
||||
skill_id = EQ::skills::Skill2HPiercing;
|
||||
}
|
||||
|
||||
return skill_caps.GetSkillTrainLevel(class_id, skill_id, RuleI(Character, MaxLevel));
|
||||
return SkillCaps::Instance()->GetSkillTrainLevel(class_id, skill_id, RuleI(Character, MaxLevel));
|
||||
}
|
||||
|
||||
uint16 Client::GetMaxSkillAfterSpecializationRules(EQ::skills::SkillType skillid, uint16 maxSkill)
|
||||
@@ -12099,7 +12099,7 @@ void Client::MaxSkills()
|
||||
auto current_skill_value = (
|
||||
EQ::skills::IsSpecializedSkill(s.first) ?
|
||||
MAX_SPECIALIZED_SKILL :
|
||||
skill_caps.GetSkillCap(GetClass(), s.first, GetLevel()).cap
|
||||
SkillCaps::Instance()->GetSkillCap(GetClass(), s.first, GetLevel()).cap
|
||||
);
|
||||
|
||||
if (GetSkill(s.first) < current_skill_value) {
|
||||
@@ -13253,3 +13253,17 @@ void Client::CheckItemDiscoverability(uint32 item_id)
|
||||
|
||||
DiscoverItem(item_id);
|
||||
}
|
||||
|
||||
bool Client::UncompleteTask(int task_id)
|
||||
{
|
||||
CompletedTasksRepository::DeleteWhere(
|
||||
database,
|
||||
fmt::format(
|
||||
"charid = {} AND taskid = {}",
|
||||
CharacterID(),
|
||||
task_id
|
||||
)
|
||||
);
|
||||
|
||||
return task_state->UncompleteTask(task_id);
|
||||
}
|
||||
|
||||
+9
-6
@@ -98,7 +98,6 @@ namespace EQ
|
||||
#define MAX_SPECIALIZED_SKILL 50
|
||||
|
||||
extern Zone* zone;
|
||||
extern TaskManager *task_manager;
|
||||
|
||||
class CLIENTPACKET
|
||||
{
|
||||
@@ -1359,7 +1358,7 @@ public:
|
||||
}
|
||||
inline bool SaveTaskState()
|
||||
{
|
||||
return task_manager != nullptr && task_manager->SaveClientState(this, task_state);
|
||||
return TaskManager::Instance()->SaveClientState(this, task_state);
|
||||
}
|
||||
inline bool IsTaskStateLoaded() { return task_state != nullptr; }
|
||||
inline bool IsTaskActive(int task_id) { return task_state != nullptr && task_state->IsTaskActive(task_id); }
|
||||
@@ -1433,14 +1432,14 @@ public:
|
||||
}
|
||||
inline void TaskSetSelector(Mob* mob, int task_set_id, bool ignore_cooldown)
|
||||
{
|
||||
if (task_manager && task_state) {
|
||||
task_manager->TaskSetSelector(this, mob, task_set_id, ignore_cooldown);
|
||||
if (task_state) {
|
||||
TaskManager::Instance()->TaskSetSelector(this, mob, task_set_id, ignore_cooldown);
|
||||
}
|
||||
}
|
||||
inline void TaskQuestSetSelector(Mob* mob, const std::vector<int>& tasks, bool ignore_cooldown)
|
||||
{
|
||||
if (task_manager && task_state) {
|
||||
task_manager->TaskQuestSetSelector(this, mob, tasks, ignore_cooldown);
|
||||
if (task_state) {
|
||||
TaskManager::Instance()->TaskQuestSetSelector(this, mob, tasks, ignore_cooldown);
|
||||
}
|
||||
}
|
||||
inline void EnableTask(int task_count, int *task_list)
|
||||
@@ -1501,6 +1500,7 @@ public:
|
||||
{
|
||||
return task_state ? task_state->CompleteTask(this, task_id) : false;
|
||||
}
|
||||
bool UncompleteTask(int task_id);
|
||||
inline void FailTask(int task_id) { if (task_state) { task_state->FailTask(this, task_id); }}
|
||||
inline int TaskTimeLeft(int task_id) { return (task_state ? task_state->TaskTimeLeft(task_id) : 0); }
|
||||
inline int EnabledTaskCount(int task_set_id)
|
||||
@@ -1959,6 +1959,9 @@ public:
|
||||
ExternalHandinMoneyReturned GetExternalHandinMoneyReturned() { return m_external_handin_money_returned; }
|
||||
std::vector<uint32_t> GetExternalHandinItemsReturned() { return m_external_handin_items_returned; }
|
||||
|
||||
// used only for testing
|
||||
inline void SetCharacterId(uint32_t id) { character_id = id; }
|
||||
|
||||
protected:
|
||||
friend class Mob;
|
||||
void CalcEdibleBonuses(StatBonuses* newbon);
|
||||
|
||||
@@ -337,24 +337,29 @@ bool Client::DoEvolveCheckProgression(EQ::ItemInstance &inst)
|
||||
!RuleB(EvolvingItems, DestroyAugmentsOnEvolve) &&
|
||||
inst.IsAugmented()
|
||||
) {
|
||||
auto const augs = inst.GetAugmentIDs();
|
||||
std::vector<CharacterParcelsRepository::CharacterParcels> parcels;
|
||||
for (auto const &item_id: augs) {
|
||||
if (!item_id) {
|
||||
continue;
|
||||
}
|
||||
auto const augs = inst.GetAugmentIDs();
|
||||
std::vector<CharacterParcelsRepository::CharacterParcels> parcels;
|
||||
int32 next_slot = FindNextFreeParcelSlotUsingMemory();
|
||||
for (auto const &item_id: augs) {
|
||||
if (!item_id) {
|
||||
continue;
|
||||
}
|
||||
|
||||
CharacterParcelsRepository::CharacterParcels p{};
|
||||
p.char_id = CharacterID();
|
||||
p.from_name = "Evolving Item Sub-System";
|
||||
p.note = fmt::format(
|
||||
"System automatically removed from {} which recently evolved.",
|
||||
inst.GetItem()->Name
|
||||
);
|
||||
p.slot_id = FindNextFreeParcelSlotUsingMemory();
|
||||
p.sent_date = time(nullptr);
|
||||
p.item_id = item_id;
|
||||
p.quantity = 1;
|
||||
if (next_slot == INVALID_INDEX) {
|
||||
break;
|
||||
}
|
||||
|
||||
CharacterParcelsRepository::CharacterParcels p{};
|
||||
p.char_id = CharacterID();
|
||||
p.from_name = "Evolving Item Sub-System";
|
||||
p.note = fmt::format(
|
||||
"System automatically removed from {} which recently evolved.",
|
||||
inst.GetItem()->Name
|
||||
);
|
||||
p.slot_id = next_slot;
|
||||
p.sent_date = time(nullptr);
|
||||
p.item_id = item_id;
|
||||
p.quantity = 1;
|
||||
|
||||
if (player_event_logs.IsEventEnabled(PlayerEvent::PARCEL_SEND)) {
|
||||
PlayerEvent::ParcelSend e{};
|
||||
@@ -367,8 +372,10 @@ bool Client::DoEvolveCheckProgression(EQ::ItemInstance &inst)
|
||||
RecordPlayerEventLog(PlayerEvent::PARCEL_SEND, e);
|
||||
}
|
||||
|
||||
parcels.push_back(p);
|
||||
}
|
||||
parcels.push_back(p);
|
||||
m_parcels.emplace(p.slot_id, p);
|
||||
next_slot = FindNextFreeParcelSlotUsingMemory();
|
||||
}
|
||||
|
||||
CharacterParcelsRepository::InsertMany(database, parcels);
|
||||
SendParcelStatus();
|
||||
|
||||
+24
-25
@@ -79,7 +79,6 @@ extern QueryServ* QServ;
|
||||
extern Zone* zone;
|
||||
extern volatile bool is_zone_loaded;
|
||||
extern WorldServer worldserver;
|
||||
extern PetitionList petition_list;
|
||||
extern EntityList entity_list;
|
||||
typedef void (Client::*ClientPacketProc)(const EQApplicationPacket *app);
|
||||
|
||||
@@ -6963,7 +6962,7 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app)
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} ({})",
|
||||
zone_store.GetZoneLongName(e.zone_id, true),
|
||||
ZoneStore::Instance()->GetZoneLongName(e.zone_id, true),
|
||||
e.zone_id
|
||||
)
|
||||
) +
|
||||
@@ -11058,7 +11057,7 @@ void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app)
|
||||
LogError("Wrong size: OP_PDeletePetition, size=[{}], expected [{}]", app->size, 2);
|
||||
return;
|
||||
}
|
||||
if (petition_list.DeletePetitionByCharName((char*)app->pBuffer))
|
||||
if (PetitionList::Instance()->DeletePetitionByCharName((char*)app->pBuffer))
|
||||
MessageString(Chat::White, PETITION_DELETED);
|
||||
else
|
||||
MessageString(Chat::White, PETITION_NO_DELETE);
|
||||
@@ -11736,7 +11735,7 @@ void Client::Handle_OP_Petition(const EQApplicationPacket *app)
|
||||
}*/
|
||||
else
|
||||
{
|
||||
if (petition_list.FindPetitionByAccountName(AccountName()))
|
||||
if (PetitionList::Instance()->FindPetitionByAccountName(AccountName()))
|
||||
{
|
||||
Message(Chat::White, "You already have a petition in the queue, you must wait for it to be answered or use /deletepetition to delete it.");
|
||||
return;
|
||||
@@ -11752,10 +11751,10 @@ void Client::Handle_OP_Petition(const EQApplicationPacket *app)
|
||||
pet->SetPetitionText((char*)app->pBuffer);
|
||||
pet->SetZone(zone->GetZoneID());
|
||||
pet->SetUrgency(0);
|
||||
petition_list.AddPetition(pet);
|
||||
PetitionList::Instance()->AddPetition(pet);
|
||||
database.InsertPetitionToDB(pet);
|
||||
petition_list.UpdateGMQueue();
|
||||
petition_list.UpdateZoneListQueue();
|
||||
PetitionList::Instance()->UpdateGMQueue();
|
||||
PetitionList::Instance()->UpdateZoneListQueue();
|
||||
worldserver.SendEmoteMessage(
|
||||
0,
|
||||
0,
|
||||
@@ -11786,16 +11785,16 @@ void Client::Handle_OP_PetitionCheckIn(const EQApplicationPacket *app)
|
||||
}
|
||||
Petition_Struct* inpet = (Petition_Struct*)app->pBuffer;
|
||||
|
||||
Petition* pet = petition_list.GetPetitionByID(inpet->petnumber);
|
||||
Petition* pet = PetitionList::Instance()->GetPetitionByID(inpet->petnumber);
|
||||
//if (inpet->urgency != pet->GetUrgency())
|
||||
pet->SetUrgency(inpet->urgency);
|
||||
pet->SetLastGM(GetName());
|
||||
pet->SetGMText(inpet->gmtext);
|
||||
|
||||
pet->SetCheckedOut(false);
|
||||
petition_list.UpdatePetition(pet);
|
||||
petition_list.UpdateGMQueue();
|
||||
petition_list.UpdateZoneListQueue();
|
||||
PetitionList::Instance()->UpdatePetition(pet);
|
||||
PetitionList::Instance()->UpdateGMQueue();
|
||||
PetitionList::Instance()->UpdateZoneListQueue();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -11809,14 +11808,14 @@ void Client::Handle_OP_PetitionCheckout(const EQApplicationPacket *app)
|
||||
Message(Chat::Red, "Error: World server disconnected");
|
||||
else {
|
||||
uint32 getpetnum = *((uint32*)app->pBuffer);
|
||||
Petition* getpet = petition_list.GetPetitionByID(getpetnum);
|
||||
Petition* getpet = PetitionList::Instance()->GetPetitionByID(getpetnum);
|
||||
if (getpet != 0) {
|
||||
getpet->AddCheckout();
|
||||
getpet->SetCheckedOut(true);
|
||||
getpet->SendPetitionToPlayer(CastToClient());
|
||||
petition_list.UpdatePetition(getpet);
|
||||
petition_list.UpdateGMQueue();
|
||||
petition_list.UpdateZoneListQueue();
|
||||
PetitionList::Instance()->UpdatePetition(getpet);
|
||||
PetitionList::Instance()->UpdateGMQueue();
|
||||
PetitionList::Instance()->UpdateZoneListQueue();
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -11836,16 +11835,16 @@ void Client::Handle_OP_PetitionDelete(const EQApplicationPacket *app)
|
||||
pet->senttime = 0;
|
||||
strcpy(pet->accountid, "");
|
||||
strcpy(pet->gmsenttoo, "");
|
||||
pet->quetotal = petition_list.GetTotalPetitions();
|
||||
pet->quetotal = PetitionList::Instance()->GetTotalPetitions();
|
||||
strcpy(pet->charname, "");
|
||||
FastQueuePacket(&outapp);
|
||||
|
||||
if (petition_list.DeletePetition(pet->petnumber) == -1)
|
||||
if (PetitionList::Instance()->DeletePetition(pet->petnumber) == -1)
|
||||
std::cout << "Something is borked with: " << pet->petnumber << std::endl;
|
||||
petition_list.ClearPetitions();
|
||||
petition_list.UpdateGMQueue();
|
||||
petition_list.ReadDatabase();
|
||||
petition_list.UpdateZoneListQueue();
|
||||
PetitionList::Instance()->ClearPetitions();
|
||||
PetitionList::Instance()->UpdateGMQueue();
|
||||
PetitionList::Instance()->ReadDatabase();
|
||||
PetitionList::Instance()->UpdateZoneListQueue();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -11880,12 +11879,12 @@ void Client::Handle_OP_PetitionUnCheckout(const EQApplicationPacket *app)
|
||||
Message(Chat::Red, "Error: World server disconnected");
|
||||
else {
|
||||
uint32 getpetnum = *((uint32*)app->pBuffer);
|
||||
Petition* getpet = petition_list.GetPetitionByID(getpetnum);
|
||||
Petition* getpet = PetitionList::Instance()->GetPetitionByID(getpetnum);
|
||||
if (getpet != 0) {
|
||||
getpet->SetCheckedOut(false);
|
||||
petition_list.UpdatePetition(getpet);
|
||||
petition_list.UpdateGMQueue();
|
||||
petition_list.UpdateZoneListQueue();
|
||||
PetitionList::Instance()->UpdatePetition(getpet);
|
||||
PetitionList::Instance()->UpdateGMQueue();
|
||||
PetitionList::Instance()->UpdateZoneListQueue();
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -57,7 +57,6 @@ extern QueryServ* QServ;
|
||||
extern Zone* zone;
|
||||
extern volatile bool is_zone_loaded;
|
||||
extern WorldServer worldserver;
|
||||
extern PetitionList petition_list;
|
||||
extern EntityList entity_list;
|
||||
|
||||
bool Client::Process() {
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
extern QueryServ* QServ;
|
||||
extern WorldServer worldserver;
|
||||
extern TaskManager *task_manager;
|
||||
extern FastMath g_Math;
|
||||
void CatchSignal(int sig_num);
|
||||
|
||||
@@ -783,161 +782,3 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
c->Message(Chat::Red, "Bots are disabled on this server.");
|
||||
}
|
||||
}
|
||||
|
||||
#include "gm_commands/acceptrules.cpp"
|
||||
#include "gm_commands/advnpcspawn.cpp"
|
||||
#include "gm_commands/aggrozone.cpp"
|
||||
#include "gm_commands/ai.cpp"
|
||||
#include "gm_commands/appearance.cpp"
|
||||
#include "gm_commands/appearanceeffects.cpp"
|
||||
#include "gm_commands/attack.cpp"
|
||||
#include "gm_commands/augmentitem.cpp"
|
||||
#include "gm_commands/ban.cpp"
|
||||
#include "gm_commands/bugs.cpp"
|
||||
#include "gm_commands/camerashake.cpp"
|
||||
#include "gm_commands/castspell.cpp"
|
||||
#include "gm_commands/chat.cpp"
|
||||
#include "gm_commands/clearxtargets.cpp"
|
||||
#include "gm_commands/copycharacter.cpp"
|
||||
#include "gm_commands/corpse.cpp"
|
||||
#include "gm_commands/corpsefix.cpp"
|
||||
#include "gm_commands/countitem.cpp"
|
||||
#include "gm_commands/damage.cpp"
|
||||
#include "gm_commands/databuckets.cpp"
|
||||
#include "gm_commands/dbspawn2.cpp"
|
||||
#include "gm_commands/delacct.cpp"
|
||||
#include "gm_commands/delpetition.cpp"
|
||||
#include "gm_commands/depop.cpp"
|
||||
#include "gm_commands/depopzone.cpp"
|
||||
#include "gm_commands/devtools.cpp"
|
||||
#include "gm_commands/disablerecipe.cpp"
|
||||
#include "gm_commands/disarmtrap.cpp"
|
||||
#include "gm_commands/doanim.cpp"
|
||||
#include "gm_commands/door.cpp"
|
||||
#include "gm_commands/door_manipulation.cpp"
|
||||
#include "gm_commands/dye.cpp"
|
||||
#include "gm_commands/dz.cpp"
|
||||
#include "gm_commands/dzkickplayers.cpp"
|
||||
#include "gm_commands/editmassrespawn.cpp"
|
||||
#include "gm_commands/emote.cpp"
|
||||
#include "gm_commands/emptyinventory.cpp"
|
||||
#include "gm_commands/enablerecipe.cpp"
|
||||
#include "gm_commands/entityvariable.cpp"
|
||||
#include "gm_commands/exptoggle.cpp"
|
||||
#include "gm_commands/faction.cpp"
|
||||
#include "gm_commands/evolving_items.cpp"
|
||||
#include "gm_commands/feature.cpp"
|
||||
#include "gm_commands/find.cpp"
|
||||
#include "gm_commands/fish.cpp"
|
||||
#include "gm_commands/fixmob.cpp"
|
||||
#include "gm_commands/flagedit.cpp"
|
||||
#include "gm_commands/fleeinfo.cpp"
|
||||
#include "gm_commands/forage.cpp"
|
||||
#include "gm_commands/gearup.cpp"
|
||||
#include "gm_commands/giveitem.cpp"
|
||||
#include "gm_commands/givemoney.cpp"
|
||||
#include "gm_commands/gmzone.cpp"
|
||||
#include "gm_commands/goto.cpp"
|
||||
#include "gm_commands/grantaa.cpp"
|
||||
#include "gm_commands/grid.cpp"
|
||||
#include "gm_commands/guild.cpp"
|
||||
#include "gm_commands/hp.cpp"
|
||||
#include "gm_commands/illusion_block.cpp"
|
||||
#include "gm_commands/instance.cpp"
|
||||
#include "gm_commands/interrogateinv.cpp"
|
||||
#include "gm_commands/interrupt.cpp"
|
||||
#include "gm_commands/invsnapshot.cpp"
|
||||
#include "gm_commands/ipban.cpp"
|
||||
#include "gm_commands/kick.cpp"
|
||||
#include "gm_commands/kill.cpp"
|
||||
#include "gm_commands/killallnpcs.cpp"
|
||||
#include "gm_commands/list.cpp"
|
||||
#include "gm_commands/lootsim.cpp"
|
||||
#include "gm_commands/loc.cpp"
|
||||
#include "gm_commands/logs.cpp"
|
||||
#include "gm_commands/makepet.cpp"
|
||||
#include "gm_commands/memspell.cpp"
|
||||
#include "gm_commands/merchantshop.cpp"
|
||||
#include "gm_commands/modifynpcstat.cpp"
|
||||
#include "gm_commands/movechar.cpp"
|
||||
#include "gm_commands/movement.cpp"
|
||||
#include "gm_commands/myskills.cpp"
|
||||
#include "gm_commands/mysql.cpp"
|
||||
#include "gm_commands/mystats.cpp"
|
||||
#include "gm_commands/npccast.cpp"
|
||||
#include "gm_commands/npcedit.cpp"
|
||||
#include "gm_commands/npceditmass.cpp"
|
||||
#include "gm_commands/npcemote.cpp"
|
||||
#include "gm_commands/npcloot.cpp"
|
||||
#include "gm_commands/npcsay.cpp"
|
||||
#include "gm_commands/npcshout.cpp"
|
||||
#include "gm_commands/npcspawn.cpp"
|
||||
#include "gm_commands/npctypespawn.cpp"
|
||||
#include "gm_commands/nudge.cpp"
|
||||
#include "gm_commands/nukebuffs.cpp"
|
||||
#include "gm_commands/nukeitem.cpp"
|
||||
#include "gm_commands/object.cpp"
|
||||
#include "gm_commands/object_manipulation.cpp"
|
||||
#include "gm_commands/parcels.cpp"
|
||||
#include "gm_commands/path.cpp"
|
||||
#include "gm_commands/peqzone.cpp"
|
||||
#include "gm_commands/petitems.cpp"
|
||||
#include "gm_commands/petname.cpp"
|
||||
#include "gm_commands/picklock.cpp"
|
||||
#include "gm_commands/profanity.cpp"
|
||||
#include "gm_commands/push.cpp"
|
||||
#include "gm_commands/raidloot.cpp"
|
||||
#include "gm_commands/randomfeatures.cpp"
|
||||
#include "gm_commands/refreshgroup.cpp"
|
||||
#include "gm_commands/reload.cpp"
|
||||
#include "gm_commands/removeitem.cpp"
|
||||
#include "gm_commands/repop.cpp"
|
||||
#include "gm_commands/resetaa.cpp"
|
||||
#include "gm_commands/resetaa_timer.cpp"
|
||||
#include "gm_commands/resetdisc_timer.cpp"
|
||||
#include "gm_commands/revoke.cpp"
|
||||
#include "gm_commands/roambox.cpp"
|
||||
#include "gm_commands/rules.cpp"
|
||||
#include "gm_commands/save.cpp"
|
||||
#include "gm_commands/scale.cpp"
|
||||
#include "gm_commands/scribespell.cpp"
|
||||
#include "gm_commands/scribespells.cpp"
|
||||
#include "gm_commands/sendzonespawns.cpp"
|
||||
#include "gm_commands/sensetrap.cpp"
|
||||
#include "gm_commands/serverrules.cpp"
|
||||
#include "gm_commands/set.cpp"
|
||||
#include "gm_commands/show.cpp"
|
||||
#include "gm_commands/shutdown.cpp"
|
||||
#include "gm_commands/spawn.cpp"
|
||||
#include "gm_commands/spawneditmass.cpp"
|
||||
#include "gm_commands/spawnfix.cpp"
|
||||
#include "gm_commands/faction_association.cpp"
|
||||
#include "gm_commands/stun.cpp"
|
||||
#include "gm_commands/summon.cpp"
|
||||
#include "gm_commands/summonburiedplayercorpse.cpp"
|
||||
#include "gm_commands/summonitem.cpp"
|
||||
#include "gm_commands/suspend.cpp"
|
||||
#include "gm_commands/suspendmulti.cpp"
|
||||
#include "gm_commands/takeplatinum.cpp"
|
||||
#include "gm_commands/task.cpp"
|
||||
#include "gm_commands/traindisc.cpp"
|
||||
#include "gm_commands/tune.cpp"
|
||||
#include "gm_commands/undye.cpp"
|
||||
#include "gm_commands/unmemspell.cpp"
|
||||
#include "gm_commands/unmemspells.cpp"
|
||||
#include "gm_commands/unscribespell.cpp"
|
||||
#include "gm_commands/unscribespells.cpp"
|
||||
#include "gm_commands/untraindisc.cpp"
|
||||
#include "gm_commands/untraindiscs.cpp"
|
||||
#include "gm_commands/wc.cpp"
|
||||
#include "gm_commands/worldshutdown.cpp"
|
||||
#include "gm_commands/worldwide.cpp"
|
||||
#include "gm_commands/wp.cpp"
|
||||
#include "gm_commands/wpadd.cpp"
|
||||
#include "gm_commands/zone.cpp"
|
||||
#include "gm_commands/zonebootup.cpp"
|
||||
#include "gm_commands/zoneshutdown.cpp"
|
||||
#include "gm_commands/zonevariable.cpp"
|
||||
#include "gm_commands/zone_instance.cpp"
|
||||
#include "gm_commands/zone_shard.cpp"
|
||||
#include "gm_commands/zsave.cpp"
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#include <regex>
|
||||
|
||||
#include "dialogue_window.h"
|
||||
|
||||
void DialogueWindow::Render(Client *c, std::string markdown)
|
||||
@@ -529,12 +527,19 @@ std::string DialogueWindow::CenterMessage(std::string message)
|
||||
return std::string();
|
||||
}
|
||||
|
||||
auto cleaned_message = message;
|
||||
std::string cleaned_message;
|
||||
cleaned_message.reserve(message.size());
|
||||
|
||||
std::regex tags("<[^>]*>");
|
||||
|
||||
if (std::regex_search(cleaned_message, tags)) {
|
||||
std::regex_replace(cleaned_message, tags, cleaned_message);
|
||||
// Strip HTML-like tags
|
||||
bool in_tag = false;
|
||||
for (char c : message) {
|
||||
if (c == '<') {
|
||||
in_tag = true;
|
||||
} else if (c == '>' && in_tag) {
|
||||
in_tag = false;
|
||||
} else if (!in_tag) {
|
||||
cleaned_message += c;
|
||||
}
|
||||
}
|
||||
|
||||
auto message_len = cleaned_message.length();
|
||||
|
||||
+139
-127
@@ -1271,6 +1271,16 @@ void Perl__failtask(int task_id)
|
||||
quest_manager.failtask(task_id);
|
||||
}
|
||||
|
||||
bool Perl__completetask(int task_id)
|
||||
{
|
||||
return quest_manager.completetask(task_id);
|
||||
}
|
||||
|
||||
bool Perl__uncompletetask(int task_id)
|
||||
{
|
||||
return quest_manager.uncompletetask(task_id);
|
||||
}
|
||||
|
||||
int Perl__tasktimeleft(int task_id)
|
||||
{
|
||||
return quest_manager.tasktimeleft(task_id);
|
||||
@@ -5115,627 +5125,627 @@ void Perl__send_player_handin_event()
|
||||
|
||||
float Perl__GetZoneSafeX(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSafeCoordinates(zone_id).x;
|
||||
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).x;
|
||||
}
|
||||
|
||||
float Perl__GetZoneSafeX(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSafeCoordinates(zone_id, version).x;
|
||||
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).x;
|
||||
}
|
||||
|
||||
float Perl__GetZoneSafeY(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSafeCoordinates(zone_id).y;
|
||||
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).y;
|
||||
}
|
||||
|
||||
float Perl__GetZoneSafeY(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSafeCoordinates(zone_id, version).y;
|
||||
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).y;
|
||||
}
|
||||
|
||||
float Perl__GetZoneSafeZ(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSafeCoordinates(zone_id).z;
|
||||
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).z;
|
||||
}
|
||||
|
||||
float Perl__GetZoneSafeZ(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSafeCoordinates(zone_id, version).z;
|
||||
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).z;
|
||||
}
|
||||
|
||||
float Perl__GetZoneSafeHeading(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSafeCoordinates(zone_id).w;
|
||||
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).w;
|
||||
}
|
||||
|
||||
float Perl__GetZoneSafeHeading(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSafeCoordinates(zone_id, version).w;
|
||||
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).w;
|
||||
}
|
||||
|
||||
float Perl__GetZoneGraveyardID(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneGraveyardID(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneGraveyardID(zone_id);
|
||||
}
|
||||
|
||||
float Perl__GetZoneGraveyardID(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneGraveyardID(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneGraveyardID(zone_id, version);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneMinimumLevel(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMinimumLevel(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMinimumLevel(zone_id);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneMinimumLevel(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMinimumLevel(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMinimumLevel(zone_id, version);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneMaximumLevel(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMaximumLevel(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMaximumLevel(zone_id);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneMaximumLevel(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMaximumLevel(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMaximumLevel(zone_id, version);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneMinimumStatus(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMinimumStatus(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMinimumStatus(zone_id);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneMinimumStatus(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMinimumStatus(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMinimumStatus(zone_id, version);
|
||||
}
|
||||
|
||||
int Perl__GetZoneTimeZone(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneTimeZone(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneTimeZone(zone_id);
|
||||
}
|
||||
|
||||
int Perl__GetZoneTimeZone(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneTimeZone(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneTimeZone(zone_id, version);
|
||||
}
|
||||
|
||||
int Perl__GetZoneMaximumPlayers(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMaximumPlayers(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMaximumPlayers(zone_id);
|
||||
}
|
||||
|
||||
int Perl__GetZoneMaximumPlayers(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMaximumPlayers(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMaximumPlayers(zone_id, version);
|
||||
}
|
||||
|
||||
uint32 Perl__GetZoneRuleSet(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneRuleSet(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneRuleSet(zone_id);
|
||||
}
|
||||
|
||||
uint32 Perl__GetZoneRuleSet(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneRuleSet(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneRuleSet(zone_id, version);
|
||||
}
|
||||
|
||||
std::string Perl__GetZoneNote(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneNote(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneNote(zone_id);
|
||||
}
|
||||
|
||||
std::string Perl__GetZoneNote(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneNote(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneNote(zone_id, version);
|
||||
}
|
||||
|
||||
float Perl__GetZoneUnderworld(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneUnderworld(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneUnderworld(zone_id);
|
||||
}
|
||||
|
||||
float Perl__GetZoneUnderworld(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneUnderworld(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneUnderworld(zone_id, version);
|
||||
}
|
||||
|
||||
float Perl__GetZoneMinimumClip(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMinimumClip(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMinimumClip(zone_id);
|
||||
}
|
||||
|
||||
float Perl__GetZoneMinimumClip(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMinimumClip(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMinimumClip(zone_id, version);
|
||||
}
|
||||
|
||||
float Perl__GetZoneMaximumClip(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMaximumClip(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMaximumClip(zone_id);
|
||||
}
|
||||
|
||||
float Perl__GetZoneMaximumClip(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMaximumClip(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMaximumClip(zone_id, version);
|
||||
}
|
||||
|
||||
float Perl__GetZoneFogMinimumClip(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFogMinimumClip(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFogMinimumClip(zone_id);
|
||||
}
|
||||
|
||||
float Perl__GetZoneFogMinimumClip(uint32 zone_id, uint8 slot)
|
||||
{
|
||||
return zone_store.GetZoneFogMinimumClip(zone_id, slot);
|
||||
return ZoneStore::Instance()->GetZoneFogMinimumClip(zone_id, slot);
|
||||
}
|
||||
|
||||
float Perl__GetZoneFogMinimumClip(uint32 zone_id, uint8 slot, int version)
|
||||
{
|
||||
return zone_store.GetZoneFogMinimumClip(zone_id, slot, version);
|
||||
return ZoneStore::Instance()->GetZoneFogMinimumClip(zone_id, slot, version);
|
||||
}
|
||||
|
||||
float Perl__GetZoneFogMaximumClip(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFogMaximumClip(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFogMaximumClip(zone_id);
|
||||
}
|
||||
|
||||
float Perl__GetZoneFogMaximumClip(uint32 zone_id, uint8 slot)
|
||||
{
|
||||
return zone_store.GetZoneFogMaximumClip(zone_id, slot);
|
||||
return ZoneStore::Instance()->GetZoneFogMaximumClip(zone_id, slot);
|
||||
}
|
||||
|
||||
float Perl__GetZoneFogMaximumClip(uint32 zone_id, uint8 slot, int version)
|
||||
{
|
||||
return zone_store.GetZoneFogMaximumClip(zone_id, slot, version);
|
||||
return ZoneStore::Instance()->GetZoneFogMaximumClip(zone_id, slot, version);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneFogRed(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFogRed(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFogRed(zone_id);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneFogRed(uint32 zone_id, uint8 slot)
|
||||
{
|
||||
return zone_store.GetZoneFogRed(zone_id, slot);
|
||||
return ZoneStore::Instance()->GetZoneFogRed(zone_id, slot);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneFogRed(uint32 zone_id, uint8 slot, int version)
|
||||
{
|
||||
return zone_store.GetZoneFogRed(zone_id, slot, version);
|
||||
return ZoneStore::Instance()->GetZoneFogRed(zone_id, slot, version);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneFogGreen(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFogGreen(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFogGreen(zone_id);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneFogGreen(uint32 zone_id, uint8 slot)
|
||||
{
|
||||
return zone_store.GetZoneFogGreen(zone_id, slot);
|
||||
return ZoneStore::Instance()->GetZoneFogGreen(zone_id, slot);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneFogGreen(uint32 zone_id, uint8 slot, int version)
|
||||
{
|
||||
return zone_store.GetZoneFogGreen(zone_id, slot, version);
|
||||
return ZoneStore::Instance()->GetZoneFogGreen(zone_id, slot, version);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneFogBlue(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFogBlue(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFogBlue(zone_id);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneFogBlue(uint32 zone_id, uint8 slot)
|
||||
{
|
||||
return zone_store.GetZoneFogBlue(zone_id, slot);
|
||||
return ZoneStore::Instance()->GetZoneFogBlue(zone_id, slot);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneFogBlue(uint32 zone_id, uint8 slot, int version)
|
||||
{
|
||||
return zone_store.GetZoneFogBlue(zone_id, slot, version);
|
||||
return ZoneStore::Instance()->GetZoneFogBlue(zone_id, slot, version);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneSky(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSky(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneSky(zone_id);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneSky(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSky(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneSky(zone_id, version);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneZType(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneZType(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneZType(zone_id);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneZType(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneZType(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneZType(zone_id, version);
|
||||
}
|
||||
|
||||
float Perl__GetZoneExperienceMultiplier(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneExperienceMultiplier(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneExperienceMultiplier(zone_id);
|
||||
}
|
||||
|
||||
float Perl__GetZoneExperienceMultiplier(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneExperienceMultiplier(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneExperienceMultiplier(zone_id, version);
|
||||
}
|
||||
|
||||
float Perl__GetZoneWalkSpeed(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneWalkSpeed(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneWalkSpeed(zone_id);
|
||||
}
|
||||
|
||||
float Perl__GetZoneWalkSpeed(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneWalkSpeed(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneWalkSpeed(zone_id, version);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneTimeType(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneTimeType(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneTimeType(zone_id);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneTimeType(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneTimeType(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneTimeType(zone_id, version);
|
||||
}
|
||||
|
||||
float Perl__GetZoneFogDensity(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFogDensity(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFogDensity(zone_id);
|
||||
}
|
||||
|
||||
float Perl__GetZoneFogDensity(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneFogDensity(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneFogDensity(zone_id, version);
|
||||
}
|
||||
|
||||
std::string Perl__GetZoneFlagNeeded(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFlagNeeded(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFlagNeeded(zone_id);
|
||||
}
|
||||
|
||||
std::string Perl__GetZoneFlagNeeded(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneFlagNeeded(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneFlagNeeded(zone_id, version);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneCanBind(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneCanBind(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneCanBind(zone_id);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneCanBind(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneCanBind(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneCanBind(zone_id, version);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneCanCombat(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneCanCombat(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneCanCombat(zone_id);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneCanCombat(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneCanCombat(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneCanCombat(zone_id, version);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneCanLevitate(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneCanLevitate(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneCanLevitate(zone_id);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneCanLevitate(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneCanLevitate(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneCanLevitate(zone_id, version);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneCastOutdoor(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneCastOutdoor(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneCastOutdoor(zone_id);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneCastOutdoor(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneCastOutdoor(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneCastOutdoor(zone_id, version);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneHotzone(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneHotzone(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneHotzone(zone_id);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneHotzone(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneHotzone(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneHotzone(zone_id, version);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneInstanceType(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneInstanceType(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneInstanceType(zone_id);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneInstanceType(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneInstanceType(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneInstanceType(zone_id, version);
|
||||
}
|
||||
|
||||
uint64 Perl__GetZoneShutdownDelay(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneShutdownDelay(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneShutdownDelay(zone_id);
|
||||
}
|
||||
|
||||
uint64 Perl__GetZoneShutdownDelay(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneShutdownDelay(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneShutdownDelay(zone_id, version);
|
||||
}
|
||||
|
||||
int8 Perl__GetZonePEQZone(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZonePEQZone(zone_id);
|
||||
return ZoneStore::Instance()->GetZonePEQZone(zone_id);
|
||||
}
|
||||
|
||||
int8 Perl__GetZonePEQZone(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZonePEQZone(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZonePEQZone(zone_id, version);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneExpansion(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneExpansion(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneExpansion(zone_id);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneExpansion(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneExpansion(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneExpansion(zone_id, version);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneBypassExpansionCheck(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneBypassExpansionCheck(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneBypassExpansionCheck(zone_id);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneBypassExpansionCheck(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneBypassExpansionCheck(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneBypassExpansionCheck(zone_id, version);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneSuspendBuffs(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSuspendBuffs(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneSuspendBuffs(zone_id);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneSuspendBuffs(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSuspendBuffs(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneSuspendBuffs(zone_id, version);
|
||||
}
|
||||
|
||||
int Perl__GetZoneRainChance(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneRainChance(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneRainChance(zone_id);
|
||||
}
|
||||
|
||||
int Perl__GetZoneRainChance(uint32 zone_id, uint8 slot)
|
||||
{
|
||||
return zone_store.GetZoneRainChance(zone_id, slot);
|
||||
return ZoneStore::Instance()->GetZoneRainChance(zone_id, slot);
|
||||
}
|
||||
|
||||
int Perl__GetZoneRainChance(uint32 zone_id, uint8 slot, int version)
|
||||
{
|
||||
return zone_store.GetZoneRainChance(zone_id, slot, version);
|
||||
return ZoneStore::Instance()->GetZoneRainChance(zone_id, slot, version);
|
||||
}
|
||||
|
||||
int Perl__GetZoneRainDuration(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneRainDuration(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneRainDuration(zone_id);
|
||||
}
|
||||
|
||||
int Perl__GetZoneRainDuration(uint32 zone_id, uint8 slot)
|
||||
{
|
||||
return zone_store.GetZoneRainDuration(zone_id, slot);
|
||||
return ZoneStore::Instance()->GetZoneRainDuration(zone_id, slot);
|
||||
}
|
||||
|
||||
int Perl__GetZoneRainDuration(uint32 zone_id, uint8 slot, int version)
|
||||
{
|
||||
return zone_store.GetZoneRainDuration(zone_id, slot, version);
|
||||
return ZoneStore::Instance()->GetZoneRainDuration(zone_id, slot, version);
|
||||
}
|
||||
|
||||
int Perl__GetZoneSnowChance(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSnowChance(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneSnowChance(zone_id);
|
||||
}
|
||||
|
||||
int Perl__GetZoneSnowChance(uint32 zone_id, uint8 slot)
|
||||
{
|
||||
return zone_store.GetZoneSnowChance(zone_id, slot);
|
||||
return ZoneStore::Instance()->GetZoneSnowChance(zone_id, slot);
|
||||
}
|
||||
|
||||
int Perl__GetZoneSnowChance(uint32 zone_id, uint8 slot, int version)
|
||||
{
|
||||
return zone_store.GetZoneSnowChance(zone_id, slot, version);
|
||||
return ZoneStore::Instance()->GetZoneSnowChance(zone_id, slot, version);
|
||||
}
|
||||
|
||||
int Perl__GetZoneSnowDuration(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSnowDuration(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneSnowDuration(zone_id);
|
||||
}
|
||||
|
||||
int Perl__GetZoneSnowDuration(uint32 zone_id, uint8 slot)
|
||||
{
|
||||
return zone_store.GetZoneSnowDuration(zone_id, slot);
|
||||
return ZoneStore::Instance()->GetZoneSnowDuration(zone_id, slot);
|
||||
}
|
||||
|
||||
int Perl__GetZoneSnowDuration(uint32 zone_id, uint8 slot, int version)
|
||||
{
|
||||
return zone_store.GetZoneSnowDuration(zone_id, slot, version);
|
||||
return ZoneStore::Instance()->GetZoneSnowDuration(zone_id, slot, version);
|
||||
}
|
||||
|
||||
float Perl__GetZoneGravity(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneGravity(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneGravity(zone_id);
|
||||
}
|
||||
|
||||
float Perl__GetZoneGravity(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneGravity(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneGravity(zone_id, version);
|
||||
}
|
||||
|
||||
int Perl__GetZoneType(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneType(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneType(zone_id);
|
||||
}
|
||||
|
||||
int Perl__GetZoneType(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneType(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneType(zone_id, version);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneSkyLock(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSkyLock(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneSkyLock(zone_id);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneSkyLock(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSkyLock(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneSkyLock(zone_id, version);
|
||||
}
|
||||
|
||||
int Perl__GetZoneFastRegenHP(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFastRegenHP(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFastRegenHP(zone_id);
|
||||
}
|
||||
|
||||
int Perl__GetZoneFastRegenHP(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneFastRegenHP(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneFastRegenHP(zone_id, version);
|
||||
}
|
||||
|
||||
int Perl__GetZoneFastRegenMana(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFastRegenMana(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFastRegenMana(zone_id);
|
||||
}
|
||||
|
||||
int Perl__GetZoneFastRegenMana(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneFastRegenMana(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneFastRegenMana(zone_id, version);
|
||||
}
|
||||
|
||||
int Perl__GetZoneFastRegenEndurance(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFastRegenEndurance(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFastRegenEndurance(zone_id);
|
||||
}
|
||||
|
||||
int Perl__GetZoneFastRegenEndurance(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneFastRegenEndurance(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneFastRegenEndurance(zone_id, version);
|
||||
}
|
||||
|
||||
int Perl__GetZoneNPCMaximumAggroDistance(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneNPCMaximumAggroDistance(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneNPCMaximumAggroDistance(zone_id);
|
||||
}
|
||||
|
||||
int Perl__GetZoneNPCMaximumAggroDistance(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneNPCMaximumAggroDistance(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneNPCMaximumAggroDistance(zone_id, version);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneMinimumExpansion(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMinimumExpansion(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMinimumExpansion(zone_id);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneMinimumExpansion(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMinimumExpansion(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMinimumExpansion(zone_id, version);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneMaximumExpansion(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMaximumExpansion(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMaximumExpansion(zone_id);
|
||||
}
|
||||
|
||||
int8 Perl__GetZoneMaximumExpansion(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMaximumExpansion(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMaximumExpansion(zone_id, version);
|
||||
}
|
||||
|
||||
std::string Perl__GetZoneContentFlags(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneContentFlags(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneContentFlags(zone_id);
|
||||
}
|
||||
|
||||
std::string Perl__GetZoneContentFlags(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneContentFlags(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneContentFlags(zone_id, version);
|
||||
}
|
||||
|
||||
std::string Perl__GetZoneContentFlagsDisabled(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneContentFlagsDisabled(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneContentFlagsDisabled(zone_id);
|
||||
}
|
||||
|
||||
std::string Perl__GetZoneContentFlagsDisabled(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneContentFlagsDisabled(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneContentFlagsDisabled(zone_id, version);
|
||||
}
|
||||
|
||||
int Perl__GetZoneUnderworldTeleportIndex(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneUnderworldTeleportIndex(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneUnderworldTeleportIndex(zone_id);
|
||||
}
|
||||
|
||||
int Perl__GetZoneUnderworldTeleportIndex(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneUnderworldTeleportIndex(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneUnderworldTeleportIndex(zone_id, version);
|
||||
}
|
||||
|
||||
int Perl__GetZoneLavaDamage(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneLavaDamage(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneLavaDamage(zone_id);
|
||||
}
|
||||
|
||||
int Perl__GetZoneLavaDamage(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneLavaDamage(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneLavaDamage(zone_id, version);
|
||||
}
|
||||
|
||||
int Perl__GetZoneMinimumLavaDamage(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMinimumLavaDamage(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMinimumLavaDamage(zone_id);
|
||||
}
|
||||
|
||||
int Perl__GetZoneMinimumLavaDamage(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMinimumLavaDamage(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMinimumLavaDamage(zone_id, version);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneIdleWhenEmpty(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneIdleWhenEmpty(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneIdleWhenEmpty(zone_id);
|
||||
}
|
||||
|
||||
uint8 Perl__GetZoneIdleWhenEmpty(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneIdleWhenEmpty(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneIdleWhenEmpty(zone_id, version);
|
||||
}
|
||||
|
||||
uint32 Perl__GetZoneSecondsBeforeIdle(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSecondsBeforeIdle(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneSecondsBeforeIdle(zone_id);
|
||||
}
|
||||
|
||||
uint32 Perl__GetZoneSecondsBeforeIdle(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSecondsBeforeIdle(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneSecondsBeforeIdle(zone_id, version);
|
||||
}
|
||||
|
||||
void Perl__send_channel_message(uint8 channel_number, uint32 guild_id, uint8 language_id, uint8 language_skill, const char* message)
|
||||
@@ -5860,12 +5870,12 @@ bool Perl__SetAutoLoginCharacterNameByAccountID(uint32 account_id, std::string c
|
||||
|
||||
uint32 Perl__GetZoneIDByLongName(std::string zone_long_name)
|
||||
{
|
||||
return zone_store.GetZoneIDByLongName(zone_long_name);
|
||||
return ZoneStore::Instance()->GetZoneIDByLongName(zone_long_name);
|
||||
}
|
||||
|
||||
std::string Perl__GetZoneShortNameByLongName(std::string zone_long_name)
|
||||
{
|
||||
return zone_store.GetZoneShortNameByLongName(zone_long_name);
|
||||
return ZoneStore::Instance()->GetZoneShortNameByLongName(zone_long_name);
|
||||
}
|
||||
|
||||
bool Perl__send_parcel(perl::reference table_ref)
|
||||
@@ -6628,6 +6638,8 @@ void perl_register_quest()
|
||||
package.add("faction", (void(*)(int, int, int))&Perl__faction);
|
||||
package.add("factionvalue", &Perl__FactionValue);
|
||||
package.add("failtask", &Perl__failtask);
|
||||
package.add("completetask", &Perl__completetask);
|
||||
package.add("uncompletetask", &Perl__uncompletetask);
|
||||
package.add("firsttaskinset", &Perl__firsttaskinset);
|
||||
package.add("follow", (void(*)(int))&Perl__follow);
|
||||
package.add("follow", (void(*)(int, int))&Perl__follow);
|
||||
|
||||
+1
-1
@@ -138,7 +138,7 @@ void Embperl::DoInit()
|
||||
LogQuests("Warning [{}]: [{}]", Config->PluginPlFile, e);
|
||||
}
|
||||
|
||||
for (auto & dir : path.GetPluginPaths()) {
|
||||
for (auto & dir : PathManager::Instance()->GetPluginPaths()) {
|
||||
try {
|
||||
//should probably read the directory in c, instead, so that
|
||||
//I can echo filenames as I do it, but c'mon... I'm lazy and this 1 line reads in all the plugins
|
||||
|
||||
+3
-11
@@ -55,7 +55,6 @@ extern Zone *zone;
|
||||
extern volatile bool is_zone_loaded;
|
||||
extern WorldServer worldserver;
|
||||
extern uint32 numclients;
|
||||
extern PetitionList petition_list;
|
||||
|
||||
extern char errorname[32];
|
||||
|
||||
@@ -3447,7 +3446,7 @@ void EntityList::SendPetitionToAdmins(Petition *pet)
|
||||
strcpy(pcus->accountid, pet->GetAccountName());
|
||||
strcpy(pcus->charname, pet->GetCharName());
|
||||
}
|
||||
pcus->quetotal = petition_list.GetTotalPetitions();
|
||||
pcus->quetotal = PetitionList::Instance()->GetTotalPetitions();
|
||||
auto it = client_list.begin();
|
||||
while (it != client_list.end()) {
|
||||
if (it->second->CastToClient()->Admin() >= AccountStatus::QuestTroupe) {
|
||||
@@ -3472,7 +3471,7 @@ void EntityList::ClearClientPetitionQueue()
|
||||
strcpy(pet->accountid, "");
|
||||
strcpy(pet->gmsenttoo, "");
|
||||
strcpy(pet->charname, "");
|
||||
pet->quetotal = petition_list.GetTotalPetitions();
|
||||
pet->quetotal = PetitionList::Instance()->GetTotalPetitions();
|
||||
auto it = client_list.begin();
|
||||
while (it != client_list.end()) {
|
||||
if (it->second->CastToClient()->Admin() >= AccountStatus::GMAdmin) {
|
||||
@@ -4175,10 +4174,6 @@ void EntityList::ProcessProximitySay(const char *message, Client *c, uint8 langu
|
||||
|
||||
void EntityList::SaveAllClientsTaskState()
|
||||
{
|
||||
if (!task_manager) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto it = client_list.begin();
|
||||
while (it != client_list.end()) {
|
||||
Client *client = it->second;
|
||||
@@ -4192,9 +4187,6 @@ void EntityList::SaveAllClientsTaskState()
|
||||
|
||||
void EntityList::ReloadAllClientsTaskState(int task_id)
|
||||
{
|
||||
if (!task_manager)
|
||||
return;
|
||||
|
||||
auto it = client_list.begin();
|
||||
while (it != client_list.end()) {
|
||||
Client *client = it->second;
|
||||
@@ -4205,7 +4197,7 @@ void EntityList::ReloadAllClientsTaskState(int task_id)
|
||||
Log(Logs::General, Logs::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName());
|
||||
client->RemoveClientTaskState();
|
||||
client->LoadClientTaskState();
|
||||
task_manager->SendActiveTasksToClient(client);
|
||||
TaskManager::Instance()->SendActiveTasksToClient(client);
|
||||
}
|
||||
}
|
||||
++it;
|
||||
|
||||
@@ -3,6 +3,15 @@
|
||||
#include "../dialogue_window.h"
|
||||
#include "../../common/repositories/data_buckets_repository.h"
|
||||
|
||||
void SendDataBucketsSubCommands(Client *c)
|
||||
{
|
||||
c->Message(Chat::White, "Usage: #databuckets delete [Key] [Character ID] [NPC ID] [Bot ID]");
|
||||
c->Message(Chat::White, "Usage: #databuckets edit [Key] [Character ID] [NPC ID] [Bot ID] [Value] [Expires]");
|
||||
c->Message(Chat::White, "Usage: #databuckets view [Partial Key] [Character ID] [NPC ID] [Bot ID]");
|
||||
c->Message(Chat::White, "Note: Character ID, NPC ID, and Bot ID are optional if not needed, if needed they are required for specificity");
|
||||
c->Message(Chat::White, "Note: Edit requires Character ID, NPC ID, Bot ID, and Value, Expires is optional and does not modify the existing expiration time if not provided");
|
||||
}
|
||||
|
||||
void command_databuckets(Client *c, const Seperator *sep)
|
||||
{
|
||||
const int arguments = sep->argnum;
|
||||
@@ -251,12 +260,3 @@ void command_databuckets(Client *c, const Seperator *sep)
|
||||
c->Message(Chat::White, response.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void SendDataBucketsSubCommands(Client *c)
|
||||
{
|
||||
c->Message(Chat::White, "Usage: #databuckets delete [Key] [Character ID] [NPC ID] [Bot ID]");
|
||||
c->Message(Chat::White, "Usage: #databuckets edit [Key] [Character ID] [NPC ID] [Bot ID] [Value] [Expires]");
|
||||
c->Message(Chat::White, "Usage: #databuckets view [Partial Key] [Character ID] [NPC ID] [Bot ID]");
|
||||
c->Message(Chat::White, "Note: Character ID, NPC ID, and Bot ID are optional if not needed, if needed they are required for specificity");
|
||||
c->Message(Chat::White, "Note: Edit requires Character ID, NPC ID, Bot ID, and Value, Expires is optional and does not modify the existing expiration time if not provided");
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "../../object.h"
|
||||
#include "../../client.h"
|
||||
|
||||
void FindObjectType(Client *c, const Seperator *sep)
|
||||
|
||||
@@ -11,7 +11,7 @@ void FindTask(Client *c, const Seperator *sep)
|
||||
|
||||
if (sep->IsNumber(2)) {
|
||||
const auto task_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
const auto& task_name = task_manager->GetTaskName(task_id);
|
||||
const auto& task_name = TaskManager::Instance()->GetTaskName(task_id);
|
||||
|
||||
if (task_name.empty()) {
|
||||
c->Message(
|
||||
@@ -41,7 +41,7 @@ void FindTask(Client *c, const Seperator *sep)
|
||||
|
||||
auto found_count = 0;
|
||||
|
||||
for (const auto& t : task_manager->GetTaskData()) {
|
||||
for (const auto& t : TaskManager::Instance()->GetTaskData()) {
|
||||
const auto& task_name = t.second.title;
|
||||
const auto& task_name_lower = Strings::ToLower(task_name);
|
||||
if (!Strings::Contains(task_name_lower, search_criteria)) {
|
||||
|
||||
+17
-17
@@ -8,6 +8,22 @@ extern QueryServ *QServ;
|
||||
#include "../guild_mgr.h"
|
||||
#include "../doors.h"
|
||||
|
||||
void SendGuildSubCommands(Client* c)
|
||||
{
|
||||
c->Message(Chat::White, "#guild create [Character ID|Character Name] [Guild Name]");
|
||||
c->Message(Chat::White, "#guild delete [Guild ID]");
|
||||
c->Message(Chat::White, "#guild details [Guild ID]");
|
||||
c->Message(Chat::White, "#guild help");
|
||||
c->Message(Chat::White, "#guild info [Guild ID]");
|
||||
c->Message(Chat::White, "#guild list");
|
||||
c->Message(Chat::White, "#guild rename [Guild ID] [New Name]");
|
||||
c->Message(Chat::White, "#guild search [Search Criteria]");
|
||||
c->Message(Chat::White, "#guild set [Character ID|Character Name] [Guild ID] (Guild ID 0 is Guildless)");
|
||||
c->Message(Chat::White, "#guild setleader [Guild ID] [Character ID|Character Name]");
|
||||
c->Message(Chat::White, "#guild setrank [Character ID|Character Name] [Rank]");
|
||||
c->Message(Chat::White, "#guild status [Character ID|Character Name]");
|
||||
}
|
||||
|
||||
void command_guild(Client* c, const Seperator* sep)
|
||||
{
|
||||
const auto arguments = sep->argnum;
|
||||
@@ -675,20 +691,4 @@ void command_guild(Client* c, const Seperator* sep)
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SendGuildSubCommands(Client* c)
|
||||
{
|
||||
c->Message(Chat::White, "#guild create [Character ID|Character Name] [Guild Name]");
|
||||
c->Message(Chat::White, "#guild delete [Guild ID]");
|
||||
c->Message(Chat::White, "#guild details [Guild ID]");
|
||||
c->Message(Chat::White, "#guild help");
|
||||
c->Message(Chat::White, "#guild info [Guild ID]");
|
||||
c->Message(Chat::White, "#guild list");
|
||||
c->Message(Chat::White, "#guild rename [Guild ID] [New Name]");
|
||||
c->Message(Chat::White, "#guild search [Search Criteria]");
|
||||
c->Message(Chat::White, "#guild set [Character ID|Character Name] [Guild ID] (Guild ID 0 is Guildless)");
|
||||
c->Message(Chat::White, "#guild setleader [Guild ID] [Character ID|Character Name]");
|
||||
c->Message(Chat::White, "#guild setrank [Character ID|Character Name] [Rank]");
|
||||
c->Message(Chat::White, "#guild status [Character ID|Character Name]");
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "../dialogue_window.h"
|
||||
#include "../client.h"
|
||||
|
||||
void command_illusion_block(Client* c, const Seperator* sep)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "../corpse.h"
|
||||
#include "../object.h"
|
||||
#include "../doors.h"
|
||||
#include "../command.h"
|
||||
|
||||
struct UniqueEntity {
|
||||
uint16 entity_id;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "../client.h"
|
||||
#include "../water_map.h"
|
||||
|
||||
void command_loc(Client *c, const Seperator *sep)
|
||||
{
|
||||
|
||||
@@ -1,63 +1,5 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_modifynpcstat(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #modifynpcstat [Stat] [Value]");
|
||||
ListModifyNPCStatMap(c);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
auto target = c->GetTarget()->CastToNPC();
|
||||
|
||||
const std::string& stat = sep->arg[1] ? sep->arg[1] : "";
|
||||
const std::string& value = sep->arg[2] ? sep->arg[2] : "";
|
||||
|
||||
if (stat.empty() || value.empty()) {
|
||||
c->Message(Chat::White, "Usage: #modifynpcstat [Stat] [Value]");
|
||||
ListModifyNPCStatMap(c);
|
||||
return;
|
||||
}
|
||||
|
||||
auto stat_description = GetModifyNPCStatDescription(stat);
|
||||
if (!stat_description.length()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Stat '{}' does not exist.",
|
||||
stat
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
target->ModifyNPCStat(stat, value);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Stat Modified | Target: {}",
|
||||
c->GetTargetDescription(target)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Stat Modified | Stat: {} ({}) Value: {}",
|
||||
GetModifyNPCStatDescription(stat),
|
||||
stat,
|
||||
value
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> GetModifyNPCStatMap()
|
||||
{
|
||||
std::map<std::string, std::string> identifiers_map = {
|
||||
@@ -134,3 +76,61 @@ void ListModifyNPCStatMap(Client *c)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void command_modifynpcstat(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #modifynpcstat [Stat] [Value]");
|
||||
ListModifyNPCStatMap(c);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
auto target = c->GetTarget()->CastToNPC();
|
||||
|
||||
const std::string& stat = sep->arg[1] ? sep->arg[1] : "";
|
||||
const std::string& value = sep->arg[2] ? sep->arg[2] : "";
|
||||
|
||||
if (stat.empty() || value.empty()) {
|
||||
c->Message(Chat::White, "Usage: #modifynpcstat [Stat] [Value]");
|
||||
ListModifyNPCStatMap(c);
|
||||
return;
|
||||
}
|
||||
|
||||
auto stat_description = GetModifyNPCStatDescription(stat);
|
||||
if (!stat_description.length()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Stat '{}' does not exist.",
|
||||
stat
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
target->ModifyNPCStat(stat, value);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Stat Modified | Target: {}",
|
||||
c->GetTargetDescription(target)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Stat Modified | Stat: {} ({}) Value: {}",
|
||||
GetModifyNPCStatDescription(stat),
|
||||
stat,
|
||||
value
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "../bot.h"
|
||||
#include "../client.h"
|
||||
|
||||
void command_mystats(Client *c, const Seperator *sep)
|
||||
|
||||
+110
-110
@@ -3,6 +3,115 @@
|
||||
#include "../raids.h"
|
||||
#include "../../common/repositories/npc_types_repository.h"
|
||||
|
||||
void SendNPCEditSubCommands(Client *c)
|
||||
{
|
||||
c->Message(Chat::White, "Usage: #npcedit name [Name] - Sets an NPC's Name");
|
||||
c->Message(Chat::White, "Usage: #npcedit lastname [Last Name] - Sets an NPC's Last Name");
|
||||
c->Message(Chat::White, "Usage: #npcedit level [Level] - Sets an NPC's Level");
|
||||
c->Message(Chat::White, "Usage: #npcedit race [Race ID] - Sets an NPC's Race");
|
||||
c->Message(Chat::White, "Usage: #npcedit class [Class ID] - Sets an NPC's Class");
|
||||
c->Message(Chat::White, "Usage: #npcedit bodytype [Body Type ID] - Sets an NPC's Bodytype");
|
||||
c->Message(Chat::White, "Usage: #npcedit hp [HP] - Sets an NPC's HP");
|
||||
c->Message(Chat::White, "Usage: #npcedit mana [Mana] - Sets an NPC's Mana");
|
||||
c->Message(Chat::White, "Usage: #npcedit gender [Gender ID] - Sets an NPC's Gender");
|
||||
c->Message(Chat::White, "Usage: #npcedit texture [Texture] - Sets an NPC's Texture");
|
||||
c->Message(Chat::White, "Usage: #npcedit helmtexture [Helmet Texture] - Sets an NPC's Helmet Texture");
|
||||
c->Message(Chat::White, "Usage: #npcedit herosforgemodel [Model Number] - Sets an NPC's Hero's Forge Model");
|
||||
c->Message(Chat::White, "Usage: #npcedit size [Size] - Sets an NPC's Size");
|
||||
c->Message(Chat::White, "Usage: #npcedit hpregen [HP Regen] - Sets an NPC's HP Regen Rate Per Tick");
|
||||
c->Message(Chat::White, "Usage: #npcedit hp_regen_per_second [HP Regen] - Sets an NPC's HP Regen Rate Per Second");
|
||||
c->Message(Chat::White, "Usage: #npcedit manaregen [Mana Regen] - Sets an NPC's Mana Regen Rate Per Tick");
|
||||
c->Message(Chat::White, "Usage: #npcedit loottable [Loottable ID] - Sets an NPC's Loottable ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit merchantid [Merchant ID] - Sets an NPC's Merchant ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit alt_currency_id [Alternate Currency ID] - Sets an NPC's Alternate Currency ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit spell [Spell List ID] - Sets an NPC's Spells List ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit npc_spells_effects_id [Spell Effects ID] - Sets an NPC's Spell Effects ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit faction [Faction ID] - Sets an NPC's Faction ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit adventure_template_id [Template ID] - Sets an NPC's Adventure Template ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit trap_template [Template ID] - Sets an NPC's Trap Template ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit damage [Minimum] [Maximum] - Sets an NPC's Damage");
|
||||
c->Message(Chat::White, "Usage: #npcedit attackcount [Attack Count] - Sets an NPC's Attack Count");
|
||||
c->Message(Chat::White, "Usage: #npcedit special_attacks [Special Attacks] - Sets an NPC's Special Attacks");
|
||||
c->Message(Chat::White, "Usage: #npcedit special_abilities [Special Abilities] - Sets an NPC's Special Abilities");
|
||||
c->Message(Chat::White, "Usage: #npcedit aggroradius [Radius] - Sets an NPC's Aggro Radius");
|
||||
c->Message(Chat::White, "Usage: #npcedit assistradius [Radius] - Sets an NPC's Assist Radius");
|
||||
c->Message(Chat::White, "Usage: #npcedit featuresave - Saves an NPC's current facial features to the database");
|
||||
c->Message(Chat::White, "Usage: #npcedit armortint_id [Armor Tint ID] - Sets an NPC's Armor Tint ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit color [Red] [Green] [Blue] - Sets an NPC's Red, Green, and Blue armor tint");
|
||||
c->Message(Chat::White, "Usage: #npcedit ammoidfile [ID File] - Sets an NPC's Ammo ID File");
|
||||
c->Message(Chat::White, "Usage: #npcedit weapon [Primary Model] [Secondary Model] - Sets an NPC's Primary and Secondary Weapon Model");
|
||||
c->Message(Chat::White, "Usage: #npcedit meleetype [Primary Type] [Secondary Type] - Sets an NPC's Melee Skill Types");
|
||||
c->Message(Chat::White, "Usage: #npcedit rangedtype [Type] - Sets an NPC's Ranged Skill Type");
|
||||
c->Message(Chat::White, "Usage: #npcedit runspeed [Run Speed] - Sets an NPC's Run Speed");
|
||||
c->Message(Chat::White, "Usage: #npcedit mr [Resistance] - Sets an NPC's Magic Resistance");
|
||||
c->Message(Chat::White, "Usage: #npcedit pr [Resistance] - Sets an NPC's Poison Resistance");
|
||||
c->Message(Chat::White, "Usage: #npcedit dr [Resistance] - Sets an NPC's Disease Resistance");
|
||||
c->Message(Chat::White, "Usage: #npcedit fr [Resistance] - Sets an NPC's Fire Resistance");
|
||||
c->Message(Chat::White, "Usage: #npcedit cr [Resistance] - Sets an NPC's Cold Resistance");
|
||||
c->Message(Chat::White, "Usage: #npcedit corrup [Resistance] - Sets an NPC's Corruption Resistance");
|
||||
c->Message(Chat::White, "Usage: #npcedit phr [Resistance] - Sets and NPC's Physical Resistance");
|
||||
c->Message(Chat::White, "Usage: #npcedit seeinvis [Flag] - Sets an NPC's See Invisible Flag [0 = Cannot See Invisible, 1 = Can See Invisible]");
|
||||
c->Message(Chat::White, "Usage: #npcedit seeinvisundead [Flag] - Sets an NPC's See Invisible vs. Undead Flag [0 = Cannot See Invisible vs. Undead, 1 = Can See Invisible vs. Undead]");
|
||||
c->Message(Chat::White, "Usage: #npcedit qglobal [Flag] - Sets an NPC's Quest Global Flag [0 = Quest Globals Off, 1 = Quest Globals On]");
|
||||
c->Message(Chat::White, "Usage: #npcedit ac [Armor Class] - Sets an NPC's Armor Class");
|
||||
c->Message(Chat::White, "Usage: #npcedit npcaggro [Flag] - Sets an NPC's NPC Aggro Flag [0 = Aggro NPCs Off, 1 = Aggro NPCs On]");
|
||||
c->Message(Chat::White, "Usage: #npcedit spawn_limit [Limit] - Sets an NPC's Spawn Limit Counter");
|
||||
c->Message(Chat::White, "Usage: #npcedit attackspeed [Attack Speed] - Sets an NPC's Attack Speed Modifier");
|
||||
c->Message(Chat::White, "Usage: #npcedit attackdelay [Attack Delay] - Sets an NPC's Attack Delay");
|
||||
c->Message(Chat::White, "Usage: #npcedit findable [Flag] - Sets an NPC's Findable Flag [0 = Not Findable, 1 = Findable]");
|
||||
c->Message(Chat::White, "Usage: #npcedit str [Strength] - Sets an NPC's Strength");
|
||||
c->Message(Chat::White, "Usage: #npcedit sta [Stamina] - Sets an NPC's Stamina");
|
||||
c->Message(Chat::White, "Usage: #npcedit agi [Agility] - Sets an NPC's Agility");
|
||||
c->Message(Chat::White, "Usage: #npcedit dex [Dexterity] - Sets an NPC's Dexterity");
|
||||
c->Message(Chat::White, "Usage: #npcedit int [Intelligence] - Sets an NPC's Intelligence");
|
||||
c->Message(Chat::White, "Usage: #npcedit wis [Wisdom] - Sets an NPC's Wisdom");
|
||||
c->Message(Chat::White, "Usage: #npcedit cha [Charisma] - Sets an NPC's Charisma");
|
||||
c->Message(Chat::White, "Usage: #npcedit seehide [Flag] - Sets an NPC's See Hide Flag [0 = Cannot See Hide, 1 = Can See Hide]");
|
||||
c->Message(Chat::White, "Usage: #npcedit seeimprovedhide [Flag] - Sets an NPC's See Improved Hide Flag [0 = Cannot See Improved Hide, 1 = Can See Improved Hide]");
|
||||
c->Message(Chat::White, "Usage: #npcedit trackable [Flag] - Sets an NPC's Trackable Flag [0 = Not Trackable, 1 = Trackable]");
|
||||
c->Message(Chat::White, "Usage: #npcedit atk [Attack] - Sets an NPC's Attack");
|
||||
c->Message(Chat::White, "Usage: #npcedit accuracy [Accuracy] - Sets an NPC's Accuracy");
|
||||
c->Message(Chat::White, "Usage: #npcedit avoidance [Avoidance] - Sets an NPC's Avoidance");
|
||||
c->Message(Chat::White, "Usage: #npcedit slow_mitigation [Slow Mitigation] - Sets an NPC's Slow Mitigation");
|
||||
c->Message(Chat::White, "Usage: #npcedit version [Version] - Sets an NPC's Version");
|
||||
c->Message(Chat::White, "Usage: #npcedit maxlevel [Max Level] - Sets an NPC's Maximum Level");
|
||||
c->Message(Chat::White, "Usage: #npcedit scalerate [Scale Rate] - Sets an NPC's Scaling Rate [50 = 50%, 100 = 100%, 200 = 200%]");
|
||||
c->Message(Chat::White, "Usage: #npcedit emoteid [Emote ID] - Sets an NPC's Emote ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit spellscale [Scale Rate] - Sets an NPC's Spell Scaling Rate [50 = 50%, 100 = 100%, 200 = 200%]");
|
||||
c->Message(Chat::White, "Usage: #npcedit healscale [Scale Rate] - Sets an NPC's Heal Scaling Rate [50 = 50%, 100 = 100%, 200 = 200%]");
|
||||
c->Message(Chat::White, "Usage: #npcedit no_target [Flag] - Sets an NPC's No Target Hotkey Flag [0 = Not Targetable with Target Hotkey, 1 = Targetable with Target Hotkey]");
|
||||
c->Message(Chat::White, "Usage: #npcedit raidtarget [Flag] - Sets an NPC's Raid Target Flag [0 = Not a Raid Target, 1 = Raid Target]");
|
||||
c->Message(Chat::White, "Usage: #npcedit armtexture [Texture] - Sets an NPC's Arm Texture");
|
||||
c->Message(Chat::White, "Usage: #npcedit bracertexture [Texture] - Sets an NPC's Bracer Texture");
|
||||
c->Message(Chat::White, "Usage: #npcedit handtexture [Texture] - Sets an NPC's Hand Texture");
|
||||
c->Message(Chat::White, "Usage: #npcedit legtexture [Texture] - Sets an NPC's Leg Texture");
|
||||
c->Message(Chat::White, "Usage: #npcedit feettexture [Texture] - Sets an NPC's Feet Texture");
|
||||
c->Message(Chat::White, "Usage: #npcedit walkspeed [Walk Speed] - Sets an NPC's Walk Speed");
|
||||
c->Message(Chat::White, "Usage: #npcedit show_name [Flag] - Sets an NPC's Show Name Flag [0 = Hidden, 1 = Shown]");
|
||||
c->Message(Chat::White, "Usage: #npcedit untargetable [Flag] - Sets an NPC's Untargetable Flag [0 = Targetable, 1 = Untargetable]");
|
||||
c->Message(Chat::White, "Usage: #npcedit charm_ac [Armor Class] - Sets an NPC's Armor Class while Charmed");
|
||||
c->Message(Chat::White, "Usage: #npcedit charm_min_dmg [Damage] - Sets an NPC's Minimum Damage while Charmed");
|
||||
c->Message(Chat::White, "Usage: #npcedit charm_max_dmg [Damage] - Sets an NPC's Maximum Damage while Charmed");
|
||||
c->Message(Chat::White, "Usage: #npcedit charm_attack_delay [Attack Delay] - Sets an NPC's Attack Delay while Charmed");
|
||||
c->Message(Chat::White, "Usage: #npcedit charm_accuracy_rating [Accuracy] - Sets an NPC's Accuracy Rating while Charmed");
|
||||
c->Message(Chat::White, "Usage: #npcedit charm_avoidance_rating [Avoidance] - Sets an NPC's Avoidance Rating while Charmed");
|
||||
c->Message(Chat::White, "Usage: #npcedit charm_atk [Attack] - Sets an NPC's Attack while Charmed");
|
||||
c->Message(Chat::White, "Usage: #npcedit skip_global_loot [Flag] - Sets an NPC's Skip Global Loot Flag [0 = Don't Skip, 1 = Skip");
|
||||
c->Message(Chat::White, "Usage: #npcedit rarespawn [Flag] - Sets an NPC's Rare Spawn Flag [0 = Not a Rare Spawn, 1 = Rare Spawn]");
|
||||
c->Message(Chat::White, "Usage: #npcedit stuck_behavior [Stuck Behavior] - Sets an NPC's Stuck Behavior [0 = Run to Target, 1 = Warp to Target, 2 = Take No Action, 3 = Evade Combat]");
|
||||
c->Message(Chat::White, "Usage: #npcedit model [Race ID] - Sets an NPC's Race Model");
|
||||
c->Message(Chat::White, "Usage: #npcedit flymode [Fly Mode] - Sets an NPC's Fly Mode [0 = Ground, 1 = Flying, 2 = Levitating, 3 = Water, 4 = Floating, 5 = Levitating While Running]");
|
||||
c->Message(Chat::White, "Usage: #npcedit always_aggro [Flag] - Sets an NPC's Always Aggro Flag [0 = Does not Always Aggro, 1 = Always Aggro]");
|
||||
c->Message(Chat::White, "Usage: #npcedit exp_mod [Modifier] - Sets an NPC's Experience Modifier [50 = 50%, 100 = 100%, 200 = 200%]");
|
||||
c->Message(Chat::White, "Usage: #npcedit heroic_strikethrough [Heroic Strikethrough] - Sets an NPC's Heroic Strikethrough");
|
||||
c->Message(Chat::White, "Usage: #npcedit faction_amount [Faction Amount] - Sets an NPC's Faction Amount");
|
||||
c->Message(Chat::White, "Usage: #npcedit keeps_sold_items [Flag] - Sets an NPC's Keeps Sold Items Flag [0 = False, 1 = True]");
|
||||
c->Message(Chat::White, "Usage: #npcedit is_parcel_merchant [Flag] - Sets an NPC's Parcel Merchant Flag [0 = False, 1 = True]");
|
||||
c->Message(Chat::White, "Usage: #npcedit setanimation [Animation ID] - Sets an NPC's Animation on Spawn (Stored in spawn2 table)");
|
||||
c->Message(Chat::White, "Usage: #npcedit respawntime [Respawn Time] - Sets an NPC's Respawn Timer in Seconds (Stored in spawn2 table)");
|
||||
c->Message(Chat::White, "Usage: #npcedit set_grid [Grid ID] - Sets an NPC's Grid ID");
|
||||
}
|
||||
|
||||
void command_npcedit(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||
@@ -1727,113 +1836,4 @@ void command_npcedit(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
c->Message(Chat::White, d.c_str());
|
||||
}
|
||||
|
||||
void SendNPCEditSubCommands(Client *c)
|
||||
{
|
||||
c->Message(Chat::White, "Usage: #npcedit name [Name] - Sets an NPC's Name");
|
||||
c->Message(Chat::White, "Usage: #npcedit lastname [Last Name] - Sets an NPC's Last Name");
|
||||
c->Message(Chat::White, "Usage: #npcedit level [Level] - Sets an NPC's Level");
|
||||
c->Message(Chat::White, "Usage: #npcedit race [Race ID] - Sets an NPC's Race");
|
||||
c->Message(Chat::White, "Usage: #npcedit class [Class ID] - Sets an NPC's Class");
|
||||
c->Message(Chat::White, "Usage: #npcedit bodytype [Body Type ID] - Sets an NPC's Bodytype");
|
||||
c->Message(Chat::White, "Usage: #npcedit hp [HP] - Sets an NPC's HP");
|
||||
c->Message(Chat::White, "Usage: #npcedit mana [Mana] - Sets an NPC's Mana");
|
||||
c->Message(Chat::White, "Usage: #npcedit gender [Gender ID] - Sets an NPC's Gender");
|
||||
c->Message(Chat::White, "Usage: #npcedit texture [Texture] - Sets an NPC's Texture");
|
||||
c->Message(Chat::White, "Usage: #npcedit helmtexture [Helmet Texture] - Sets an NPC's Helmet Texture");
|
||||
c->Message(Chat::White, "Usage: #npcedit herosforgemodel [Model Number] - Sets an NPC's Hero's Forge Model");
|
||||
c->Message(Chat::White, "Usage: #npcedit size [Size] - Sets an NPC's Size");
|
||||
c->Message(Chat::White, "Usage: #npcedit hpregen [HP Regen] - Sets an NPC's HP Regen Rate Per Tick");
|
||||
c->Message(Chat::White, "Usage: #npcedit hp_regen_per_second [HP Regen] - Sets an NPC's HP Regen Rate Per Second");
|
||||
c->Message(Chat::White, "Usage: #npcedit manaregen [Mana Regen] - Sets an NPC's Mana Regen Rate Per Tick");
|
||||
c->Message(Chat::White, "Usage: #npcedit loottable [Loottable ID] - Sets an NPC's Loottable ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit merchantid [Merchant ID] - Sets an NPC's Merchant ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit alt_currency_id [Alternate Currency ID] - Sets an NPC's Alternate Currency ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit spell [Spell List ID] - Sets an NPC's Spells List ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit npc_spells_effects_id [Spell Effects ID] - Sets an NPC's Spell Effects ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit faction [Faction ID] - Sets an NPC's Faction ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit adventure_template_id [Template ID] - Sets an NPC's Adventure Template ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit trap_template [Template ID] - Sets an NPC's Trap Template ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit damage [Minimum] [Maximum] - Sets an NPC's Damage");
|
||||
c->Message(Chat::White, "Usage: #npcedit attackcount [Attack Count] - Sets an NPC's Attack Count");
|
||||
c->Message(Chat::White, "Usage: #npcedit special_attacks [Special Attacks] - Sets an NPC's Special Attacks");
|
||||
c->Message(Chat::White, "Usage: #npcedit special_abilities [Special Abilities] - Sets an NPC's Special Abilities");
|
||||
c->Message(Chat::White, "Usage: #npcedit aggroradius [Radius] - Sets an NPC's Aggro Radius");
|
||||
c->Message(Chat::White, "Usage: #npcedit assistradius [Radius] - Sets an NPC's Assist Radius");
|
||||
c->Message(Chat::White, "Usage: #npcedit featuresave - Saves an NPC's current facial features to the database");
|
||||
c->Message(Chat::White, "Usage: #npcedit armortint_id [Armor Tint ID] - Sets an NPC's Armor Tint ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit color [Red] [Green] [Blue] - Sets an NPC's Red, Green, and Blue armor tint");
|
||||
c->Message(Chat::White, "Usage: #npcedit ammoidfile [ID File] - Sets an NPC's Ammo ID File");
|
||||
c->Message(Chat::White, "Usage: #npcedit weapon [Primary Model] [Secondary Model] - Sets an NPC's Primary and Secondary Weapon Model");
|
||||
c->Message(Chat::White, "Usage: #npcedit meleetype [Primary Type] [Secondary Type] - Sets an NPC's Melee Skill Types");
|
||||
c->Message(Chat::White, "Usage: #npcedit rangedtype [Type] - Sets an NPC's Ranged Skill Type");
|
||||
c->Message(Chat::White, "Usage: #npcedit runspeed [Run Speed] - Sets an NPC's Run Speed");
|
||||
c->Message(Chat::White, "Usage: #npcedit mr [Resistance] - Sets an NPC's Magic Resistance");
|
||||
c->Message(Chat::White, "Usage: #npcedit pr [Resistance] - Sets an NPC's Poison Resistance");
|
||||
c->Message(Chat::White, "Usage: #npcedit dr [Resistance] - Sets an NPC's Disease Resistance");
|
||||
c->Message(Chat::White, "Usage: #npcedit fr [Resistance] - Sets an NPC's Fire Resistance");
|
||||
c->Message(Chat::White, "Usage: #npcedit cr [Resistance] - Sets an NPC's Cold Resistance");
|
||||
c->Message(Chat::White, "Usage: #npcedit corrup [Resistance] - Sets an NPC's Corruption Resistance");
|
||||
c->Message(Chat::White, "Usage: #npcedit phr [Resistance] - Sets and NPC's Physical Resistance");
|
||||
c->Message(Chat::White, "Usage: #npcedit seeinvis [Flag] - Sets an NPC's See Invisible Flag [0 = Cannot See Invisible, 1 = Can See Invisible]");
|
||||
c->Message(Chat::White, "Usage: #npcedit seeinvisundead [Flag] - Sets an NPC's See Invisible vs. Undead Flag [0 = Cannot See Invisible vs. Undead, 1 = Can See Invisible vs. Undead]");
|
||||
c->Message(Chat::White, "Usage: #npcedit qglobal [Flag] - Sets an NPC's Quest Global Flag [0 = Quest Globals Off, 1 = Quest Globals On]");
|
||||
c->Message(Chat::White, "Usage: #npcedit ac [Armor Class] - Sets an NPC's Armor Class");
|
||||
c->Message(Chat::White, "Usage: #npcedit npcaggro [Flag] - Sets an NPC's NPC Aggro Flag [0 = Aggro NPCs Off, 1 = Aggro NPCs On]");
|
||||
c->Message(Chat::White, "Usage: #npcedit spawn_limit [Limit] - Sets an NPC's Spawn Limit Counter");
|
||||
c->Message(Chat::White, "Usage: #npcedit attackspeed [Attack Speed] - Sets an NPC's Attack Speed Modifier");
|
||||
c->Message(Chat::White, "Usage: #npcedit attackdelay [Attack Delay] - Sets an NPC's Attack Delay");
|
||||
c->Message(Chat::White, "Usage: #npcedit findable [Flag] - Sets an NPC's Findable Flag [0 = Not Findable, 1 = Findable]");
|
||||
c->Message(Chat::White, "Usage: #npcedit str [Strength] - Sets an NPC's Strength");
|
||||
c->Message(Chat::White, "Usage: #npcedit sta [Stamina] - Sets an NPC's Stamina");
|
||||
c->Message(Chat::White, "Usage: #npcedit agi [Agility] - Sets an NPC's Agility");
|
||||
c->Message(Chat::White, "Usage: #npcedit dex [Dexterity] - Sets an NPC's Dexterity");
|
||||
c->Message(Chat::White, "Usage: #npcedit int [Intelligence] - Sets an NPC's Intelligence");
|
||||
c->Message(Chat::White, "Usage: #npcedit wis [Wisdom] - Sets an NPC's Wisdom");
|
||||
c->Message(Chat::White, "Usage: #npcedit cha [Charisma] - Sets an NPC's Charisma");
|
||||
c->Message(Chat::White, "Usage: #npcedit seehide [Flag] - Sets an NPC's See Hide Flag [0 = Cannot See Hide, 1 = Can See Hide]");
|
||||
c->Message(Chat::White, "Usage: #npcedit seeimprovedhide [Flag] - Sets an NPC's See Improved Hide Flag [0 = Cannot See Improved Hide, 1 = Can See Improved Hide]");
|
||||
c->Message(Chat::White, "Usage: #npcedit trackable [Flag] - Sets an NPC's Trackable Flag [0 = Not Trackable, 1 = Trackable]");
|
||||
c->Message(Chat::White, "Usage: #npcedit atk [Attack] - Sets an NPC's Attack");
|
||||
c->Message(Chat::White, "Usage: #npcedit accuracy [Accuracy] - Sets an NPC's Accuracy");
|
||||
c->Message(Chat::White, "Usage: #npcedit avoidance [Avoidance] - Sets an NPC's Avoidance");
|
||||
c->Message(Chat::White, "Usage: #npcedit slow_mitigation [Slow Mitigation] - Sets an NPC's Slow Mitigation");
|
||||
c->Message(Chat::White, "Usage: #npcedit version [Version] - Sets an NPC's Version");
|
||||
c->Message(Chat::White, "Usage: #npcedit maxlevel [Max Level] - Sets an NPC's Maximum Level");
|
||||
c->Message(Chat::White, "Usage: #npcedit scalerate [Scale Rate] - Sets an NPC's Scaling Rate [50 = 50%, 100 = 100%, 200 = 200%]");
|
||||
c->Message(Chat::White, "Usage: #npcedit emoteid [Emote ID] - Sets an NPC's Emote ID");
|
||||
c->Message(Chat::White, "Usage: #npcedit spellscale [Scale Rate] - Sets an NPC's Spell Scaling Rate [50 = 50%, 100 = 100%, 200 = 200%]");
|
||||
c->Message(Chat::White, "Usage: #npcedit healscale [Scale Rate] - Sets an NPC's Heal Scaling Rate [50 = 50%, 100 = 100%, 200 = 200%]");
|
||||
c->Message(Chat::White, "Usage: #npcedit no_target [Flag] - Sets an NPC's No Target Hotkey Flag [0 = Not Targetable with Target Hotkey, 1 = Targetable with Target Hotkey]");
|
||||
c->Message(Chat::White, "Usage: #npcedit raidtarget [Flag] - Sets an NPC's Raid Target Flag [0 = Not a Raid Target, 1 = Raid Target]");
|
||||
c->Message(Chat::White, "Usage: #npcedit armtexture [Texture] - Sets an NPC's Arm Texture");
|
||||
c->Message(Chat::White, "Usage: #npcedit bracertexture [Texture] - Sets an NPC's Bracer Texture");
|
||||
c->Message(Chat::White, "Usage: #npcedit handtexture [Texture] - Sets an NPC's Hand Texture");
|
||||
c->Message(Chat::White, "Usage: #npcedit legtexture [Texture] - Sets an NPC's Leg Texture");
|
||||
c->Message(Chat::White, "Usage: #npcedit feettexture [Texture] - Sets an NPC's Feet Texture");
|
||||
c->Message(Chat::White, "Usage: #npcedit walkspeed [Walk Speed] - Sets an NPC's Walk Speed");
|
||||
c->Message(Chat::White, "Usage: #npcedit show_name [Flag] - Sets an NPC's Show Name Flag [0 = Hidden, 1 = Shown]");
|
||||
c->Message(Chat::White, "Usage: #npcedit untargetable [Flag] - Sets an NPC's Untargetable Flag [0 = Targetable, 1 = Untargetable]");
|
||||
c->Message(Chat::White, "Usage: #npcedit charm_ac [Armor Class] - Sets an NPC's Armor Class while Charmed");
|
||||
c->Message(Chat::White, "Usage: #npcedit charm_min_dmg [Damage] - Sets an NPC's Minimum Damage while Charmed");
|
||||
c->Message(Chat::White, "Usage: #npcedit charm_max_dmg [Damage] - Sets an NPC's Maximum Damage while Charmed");
|
||||
c->Message(Chat::White, "Usage: #npcedit charm_attack_delay [Attack Delay] - Sets an NPC's Attack Delay while Charmed");
|
||||
c->Message(Chat::White, "Usage: #npcedit charm_accuracy_rating [Accuracy] - Sets an NPC's Accuracy Rating while Charmed");
|
||||
c->Message(Chat::White, "Usage: #npcedit charm_avoidance_rating [Avoidance] - Sets an NPC's Avoidance Rating while Charmed");
|
||||
c->Message(Chat::White, "Usage: #npcedit charm_atk [Attack] - Sets an NPC's Attack while Charmed");
|
||||
c->Message(Chat::White, "Usage: #npcedit skip_global_loot [Flag] - Sets an NPC's Skip Global Loot Flag [0 = Don't Skip, 1 = Skip");
|
||||
c->Message(Chat::White, "Usage: #npcedit rarespawn [Flag] - Sets an NPC's Rare Spawn Flag [0 = Not a Rare Spawn, 1 = Rare Spawn]");
|
||||
c->Message(Chat::White, "Usage: #npcedit stuck_behavior [Stuck Behavior] - Sets an NPC's Stuck Behavior [0 = Run to Target, 1 = Warp to Target, 2 = Take No Action, 3 = Evade Combat]");
|
||||
c->Message(Chat::White, "Usage: #npcedit model [Race ID] - Sets an NPC's Race Model");
|
||||
c->Message(Chat::White, "Usage: #npcedit flymode [Fly Mode] - Sets an NPC's Fly Mode [0 = Ground, 1 = Flying, 2 = Levitating, 3 = Water, 4 = Floating, 5 = Levitating While Running]");
|
||||
c->Message(Chat::White, "Usage: #npcedit always_aggro [Flag] - Sets an NPC's Always Aggro Flag [0 = Does not Always Aggro, 1 = Always Aggro]");
|
||||
c->Message(Chat::White, "Usage: #npcedit exp_mod [Modifier] - Sets an NPC's Experience Modifier [50 = 50%, 100 = 100%, 200 = 200%]");
|
||||
c->Message(Chat::White, "Usage: #npcedit heroic_strikethrough [Heroic Strikethrough] - Sets an NPC's Heroic Strikethrough");
|
||||
c->Message(Chat::White, "Usage: #npcedit faction_amount [Faction Amount] - Sets an NPC's Faction Amount");
|
||||
c->Message(Chat::White, "Usage: #npcedit keeps_sold_items [Flag] - Sets an NPC's Keeps Sold Items Flag [0 = False, 1 = True]");
|
||||
c->Message(Chat::White, "Usage: #npcedit is_parcel_merchant [Flag] - Sets an NPC's Parcel Merchant Flag [0 = False, 1 = True]");
|
||||
c->Message(Chat::White, "Usage: #npcedit setanimation [Animation ID] - Sets an NPC's Animation on Spawn (Stored in spawn2 table)");
|
||||
c->Message(Chat::White, "Usage: #npcedit respawntime [Respawn Time] - Sets an NPC's Respawn Timer in Seconds (Stored in spawn2 table)");
|
||||
c->Message(Chat::White, "Usage: #npcedit set_grid [Grid ID] - Sets an NPC's Grid ID");
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,23 @@
|
||||
#include "../client.h"
|
||||
#include "../queryserv.h"
|
||||
#include "../worldserver.h"
|
||||
#include "../../common/events/player_events.h"
|
||||
#include "../../common/events/player_event_logs.h"
|
||||
#include "../string_ids.h"
|
||||
|
||||
extern QueryServ *QServ;
|
||||
extern WorldServer worldserver;
|
||||
|
||||
void SendParcelsSubCommands(Client *c)
|
||||
{
|
||||
c->Message(Chat::White, "#parcels listdb [Character Name]");
|
||||
c->Message(Chat::White, "#parcels listmemory [Character Name] (Must be in the same zone)");
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"#parcels add [Character Name] [item id] [quantity] [note]. To send money use item id of 99990. Quantity is valid for stackable items, charges on an item, or amount of copper."
|
||||
);
|
||||
c->Message(Chat::White, "#parcels details [Character Name]");
|
||||
}
|
||||
|
||||
void command_parcels(Client *c, const Seperator *sep)
|
||||
{
|
||||
const auto arguments = sep->argnum;
|
||||
@@ -305,15 +319,4 @@ void command_parcels(Client *c, const Seperator *sep)
|
||||
c->SendParcelDeliveryToWorld(ps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SendParcelsSubCommands(Client *c)
|
||||
{
|
||||
c->Message(Chat::White, "#parcels listdb [Character Name]");
|
||||
c->Message(Chat::White, "#parcels listmemory [Character Name] (Must be in the same zone)");
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"#parcels add [Character Name] [item id] [quantity] [note]. To send money use item id of 99990. Quantity is valid for stackable items, charges on an item, or amount of copper."
|
||||
);
|
||||
c->Message(Chat::White, "#parcels details [Character Name]");
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "../bot.h"
|
||||
#include "../client.h"
|
||||
|
||||
void command_petitems(Client *c, const Seperator *sep)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "../../bot.h"
|
||||
#include "../../client.h"
|
||||
|
||||
void SetHaste(Client *c, const Seperator *sep)
|
||||
|
||||
@@ -273,7 +273,7 @@ void SetZoneData(Client *c, const Seperator *sep)
|
||||
entity_list.QueueClients(c, outapp);
|
||||
safe_delete(outapp);
|
||||
|
||||
zone_store.LoadZones(content_db);
|
||||
ZoneStore::Instance()->LoadZones(content_db);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
#include "../../client.h"
|
||||
#include "../../object.h"
|
||||
|
||||
void SendShowInventorySubCommands(Client* c) {
|
||||
c->Message(Chat::White, "Usage: #show inventory equip - Shows items in Equipment slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory gen - Shows items in General slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory cursor - Shows items in Cursor slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory poss - Shows items in Equipment, General, and Cursor slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory limbo - Shows items in Limbo slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory curlim - Shows items in Cursor and Limbo slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory trib - Shows items in Tribute slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory bank - Shows items in Bank slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory shbank - Shows items in Shared Bank slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory allbank - Shows items in Bank and Shared Bank slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory trade - Shows items in Trade slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory world - Shows items in World slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory all - Shows items in all slots");
|
||||
}
|
||||
|
||||
void ShowInventory(Client *c, const Seperator *sep)
|
||||
{
|
||||
const auto arguments = sep->argnum;
|
||||
@@ -432,20 +448,4 @@ void ShowInventory(Client *c, const Seperator *sep)
|
||||
if (!found_items) {
|
||||
c->Message(Chat::White, "No items found.");
|
||||
}
|
||||
}
|
||||
|
||||
void SendShowInventorySubCommands(Client* c) {
|
||||
c->Message(Chat::White, "Usage: #show inventory equip - Shows items in Equipment slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory gen - Shows items in General slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory cursor - Shows items in Cursor slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory poss - Shows items in Equipment, General, and Cursor slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory limbo - Shows items in Limbo slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory curlim - Shows items in Cursor and Limbo slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory trib - Shows items in Tribute slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory bank - Shows items in Bank slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory shbank - Shows items in Shared Bank slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory allbank - Shows items in Bank and Shared Bank slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory trade - Shows items in Trade slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory world - Shows items in World slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory all - Shows items in all slots");
|
||||
}
|
||||
}
|
||||
+10
-19
@@ -176,7 +176,7 @@ void command_task(Client *c, const Seperator *sep)
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Assigned {} (ID {}) to {}.",
|
||||
task_manager->GetTaskName(task_id),
|
||||
TaskManager::Instance()->GetTaskName(task_id),
|
||||
task_id,
|
||||
c->GetTargetDescription(t)
|
||||
).c_str()
|
||||
@@ -197,7 +197,7 @@ void command_task(Client *c, const Seperator *sep)
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Successfully completed {} (ID {}) for {}.",
|
||||
task_manager->GetTaskName(task_id),
|
||||
TaskManager::Instance()->GetTaskName(task_id),
|
||||
task_id,
|
||||
c->GetTargetDescription(t)
|
||||
).c_str()
|
||||
@@ -207,7 +207,7 @@ void command_task(Client *c, const Seperator *sep)
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Failed to complete {} (ID {}) for {}.",
|
||||
task_manager->GetTaskName(task_id),
|
||||
TaskManager::Instance()->GetTaskName(task_id),
|
||||
task_id,
|
||||
c->GetTargetDescription(t)
|
||||
).c_str()
|
||||
@@ -220,7 +220,7 @@ void command_task(Client *c, const Seperator *sep)
|
||||
"{} {} not have not {} (ID {}) assigned to them.",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
||||
c == t ? "do" : "does",
|
||||
task_manager->GetTaskName(task_id),
|
||||
TaskManager::Instance()->GetTaskName(task_id),
|
||||
task_id
|
||||
).c_str()
|
||||
);
|
||||
@@ -256,7 +256,7 @@ void command_task(Client *c, const Seperator *sep)
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Attempting to reload {} (ID {}).",
|
||||
task_manager->GetTaskName(task_id),
|
||||
TaskManager::Instance()->GetTaskName(task_id),
|
||||
task_id
|
||||
).c_str()
|
||||
);
|
||||
@@ -265,7 +265,7 @@ void command_task(Client *c, const Seperator *sep)
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Successfully reloaded {} (ID {}).",
|
||||
task_manager->GetTaskName(task_id),
|
||||
TaskManager::Instance()->GetTaskName(task_id),
|
||||
task_id
|
||||
).c_str()
|
||||
);
|
||||
@@ -304,21 +304,12 @@ void command_task(Client *c, const Seperator *sep)
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
CompletedTasksRepository::DeleteWhere(
|
||||
database,
|
||||
fmt::format(
|
||||
"charid = {} AND taskid = {}",
|
||||
t->CharacterID(),
|
||||
task_id
|
||||
)
|
||||
)
|
||||
) {
|
||||
if (t->UncompleteTask(task_id)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Successfully uncompleted {} (ID {}) for {}.",
|
||||
task_manager->GetTaskName(task_id),
|
||||
TaskManager::Instance()->GetTaskName(task_id),
|
||||
task_id,
|
||||
c->GetTargetDescription(t)
|
||||
).c_str()
|
||||
@@ -330,7 +321,7 @@ void command_task(Client *c, const Seperator *sep)
|
||||
"{} {} not completed {} (ID {}).",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
||||
c == t ? "have" : "has",
|
||||
task_manager->GetTaskName(task_id),
|
||||
TaskManager::Instance()->GetTaskName(task_id),
|
||||
task_id
|
||||
).c_str()
|
||||
);
|
||||
@@ -353,7 +344,7 @@ void command_task(Client *c, const Seperator *sep)
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Updating {} (ID {}), activity {} with a count of {} for {}.",
|
||||
task_manager->GetTaskName(task_id),
|
||||
TaskManager::Instance()->GetTaskName(task_id),
|
||||
task_id,
|
||||
activity_id,
|
||||
count,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "../bot.h"
|
||||
#include "../client.h"
|
||||
|
||||
void command_zone(Client *c, const Seperator *sep)
|
||||
@@ -25,7 +26,7 @@ void command_zone(Client *c, const Seperator *sep)
|
||||
}
|
||||
else {
|
||||
// validate
|
||||
if (!zone_store.GetZone(zone_input)) {
|
||||
if (!ZoneStore::Instance()->GetZone(zone_input)) {
|
||||
c->Message(Chat::White, fmt::format("Could not find zone by short_name [{}]", zone_input).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ void command_zone_shard(Client *c, const Seperator *sep)
|
||||
}
|
||||
else {
|
||||
// validate
|
||||
if (!zone_store.GetZone(zone_input)) {
|
||||
if (!ZoneStore::Instance()->GetZone(zone_input)) {
|
||||
c->Message(Chat::White, fmt::format("Could not find zone by short_name [{}]", zone_input).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "../common/repositories/guild_bank_repository.h"
|
||||
#include "../zone/petitions.h"
|
||||
|
||||
extern PetitionList petition_list;
|
||||
//extern GuildRanks_Struct guilds[512];
|
||||
//extern ZoneDatabase database;
|
||||
|
||||
|
||||
@@ -3584,6 +3584,24 @@ bool Lua_Client::KeyRingRemove(uint32 item_id)
|
||||
return self->KeyRingRemove(item_id);
|
||||
}
|
||||
|
||||
|
||||
bool Lua_Client::CompleteTask(int task_id)
|
||||
{
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->CompleteTask(task_id);
|
||||
}
|
||||
|
||||
bool Lua_Client::UncompleteTask(int task_id)
|
||||
{
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->UncompleteTask(task_id);
|
||||
}
|
||||
|
||||
void Lua_Client::EnableTitleSet(uint32 title_set) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->EnableTitle(title_set);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_client() {
|
||||
return luabind::class_<Lua_Client, Lua_Mob>("Client")
|
||||
.def(luabind::constructor<>())
|
||||
@@ -3663,6 +3681,7 @@ luabind::scope lua_register_client() {
|
||||
.def("ClearPEQZoneFlag", (void(Lua_Client::*)(uint32))&Lua_Client::ClearPEQZoneFlag)
|
||||
.def("ClearXTargets", (void(Lua_Client::*)(void))&Lua_Client::ClearXTargets)
|
||||
.def("ClearZoneFlag", (void(Lua_Client::*)(uint32))&Lua_Client::ClearZoneFlag)
|
||||
.def("CompleteTask", (bool(Lua_Client::*)(int))&Lua_Client::CompleteTask)
|
||||
.def("Connected", (bool(Lua_Client::*)(void))&Lua_Client::Connected)
|
||||
.def("CountAugmentEquippedByID", (uint32(Lua_Client::*)(uint32))&Lua_Client::CountAugmentEquippedByID)
|
||||
.def("CountItem", (uint32(Lua_Client::*)(uint32))&Lua_Client::CountItem)
|
||||
@@ -3693,6 +3712,7 @@ luabind::scope lua_register_client() {
|
||||
.def("EnableAreaHPRegen", &Lua_Client::EnableAreaHPRegen)
|
||||
.def("EnableAreaManaRegen", &Lua_Client::EnableAreaManaRegen)
|
||||
.def("EnableAreaRegens", &Lua_Client::EnableAreaRegens)
|
||||
.def("EnableTitleSet", &Lua_Client::EnableTitleSet)
|
||||
.def("EndSharedTask", (void(Lua_Client::*)(void))&Lua_Client::EndSharedTask)
|
||||
.def("EndSharedTask", (void(Lua_Client::*)(bool))&Lua_Client::EndSharedTask)
|
||||
.def("Escape", (void(Lua_Client::*)(void))&Lua_Client::Escape)
|
||||
@@ -4156,6 +4176,7 @@ luabind::scope lua_register_client() {
|
||||
.def("TrainDisc", (void(Lua_Client::*)(int))&Lua_Client::TrainDisc)
|
||||
.def("TrainDiscBySpellID", (void(Lua_Client::*)(int32))&Lua_Client::TrainDiscBySpellID)
|
||||
.def("UnFreeze", (void(Lua_Client::*)(void))&Lua_Client::UnFreeze)
|
||||
.def("UncompleteTask", (bool(Lua_Client::*)(int))&Lua_Client::UncompleteTask)
|
||||
.def("Undye", (void(Lua_Client::*)(void))&Lua_Client::Undye)
|
||||
.def("UnmemSpell", (void(Lua_Client::*)(int))&Lua_Client::UnmemSpell)
|
||||
.def("UnmemSpell", (void(Lua_Client::*)(int,bool))&Lua_Client::UnmemSpell)
|
||||
|
||||
@@ -297,6 +297,7 @@ public:
|
||||
int GetClientVersion();
|
||||
uint32 GetClientVersionBit();
|
||||
void SetTitleSuffix(const char *text);
|
||||
void EnableTitleSet(uint32 title_set);
|
||||
void SetAAPoints(int points);
|
||||
int GetAAPoints();
|
||||
int GetSpentAA();
|
||||
@@ -521,6 +522,8 @@ public:
|
||||
bool KeyRingClear();
|
||||
void KeyRingList();
|
||||
bool KeyRingRemove(uint32 item_id);
|
||||
bool CompleteTask(int task_id);
|
||||
bool UncompleteTask(int task_id);
|
||||
|
||||
// account data buckets
|
||||
void SetAccountBucket(std::string bucket_name, std::string bucket_value);
|
||||
|
||||
+133
-150
@@ -722,6 +722,14 @@ void lua_fail_task(int task_id) {
|
||||
quest_manager.failtask(task_id);
|
||||
}
|
||||
|
||||
bool lua_complete_task(int task_id) {
|
||||
return quest_manager.completetask(task_id);
|
||||
}
|
||||
|
||||
bool lua_uncomplete_task(int task_id) {
|
||||
return quest_manager.uncompletetask(task_id);
|
||||
}
|
||||
|
||||
int lua_task_time_left(int task_id) {
|
||||
return quest_manager.tasktimeleft(task_id);
|
||||
}
|
||||
@@ -4157,607 +4165,607 @@ void lua_send_player_handin_event()
|
||||
|
||||
float lua_get_zone_safe_x(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSafeCoordinates(zone_id).x;
|
||||
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).x;
|
||||
}
|
||||
|
||||
float lua_get_zone_safe_x(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSafeCoordinates(zone_id, version).x;
|
||||
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).x;
|
||||
}
|
||||
|
||||
float lua_get_zone_safe_y(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSafeCoordinates(zone_id).y;
|
||||
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).y;
|
||||
}
|
||||
|
||||
float lua_get_zone_safe_y(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSafeCoordinates(zone_id, version).y;
|
||||
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).y;
|
||||
}
|
||||
|
||||
float lua_get_zone_safe_z(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSafeCoordinates(zone_id).z;
|
||||
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).z;
|
||||
}
|
||||
|
||||
float lua_get_zone_safe_z(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSafeCoordinates(zone_id, version).z;
|
||||
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).z;
|
||||
}
|
||||
|
||||
float lua_get_zone_safe_heading(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSafeCoordinates(zone_id).w;
|
||||
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id).w;
|
||||
}
|
||||
|
||||
float lua_get_zone_safe_heading(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSafeCoordinates(zone_id, version).w;
|
||||
return ZoneStore::Instance()->GetZoneSafeCoordinates(zone_id, version).w;
|
||||
}
|
||||
|
||||
float lua_get_zone_graveyard_id(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneGraveyardID(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneGraveyardID(zone_id);
|
||||
}
|
||||
|
||||
float lua_get_zone_graveyard_id(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneGraveyardID(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneGraveyardID(zone_id, version);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_minimum_level(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMinimumLevel(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMinimumLevel(zone_id);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_minimum_level(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMinimumLevel(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMinimumLevel(zone_id, version);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_maximum_level(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMaximumLevel(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMaximumLevel(zone_id);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_maximum_level(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMaximumLevel(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMaximumLevel(zone_id, version);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_minimum_status(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMinimumStatus(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMinimumStatus(zone_id);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_minimum_status(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMinimumStatus(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMinimumStatus(zone_id, version);
|
||||
}
|
||||
|
||||
int lua_get_zone_time_zone(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneTimeZone(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneTimeZone(zone_id);
|
||||
}
|
||||
|
||||
int lua_get_zone_time_zone(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneTimeZone(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneTimeZone(zone_id, version);
|
||||
}
|
||||
|
||||
int lua_get_zone_maximum_players(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMaximumPlayers(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMaximumPlayers(zone_id);
|
||||
}
|
||||
|
||||
int lua_get_zone_maximum_players(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMaximumPlayers(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMaximumPlayers(zone_id, version);
|
||||
}
|
||||
|
||||
uint32 lua_get_zone_rule_set(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneRuleSet(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneRuleSet(zone_id);
|
||||
}
|
||||
|
||||
uint32 lua_get_zone_rule_set(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneRuleSet(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneRuleSet(zone_id, version);
|
||||
}
|
||||
|
||||
std::string lua_get_zone_note(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneNote(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneNote(zone_id);
|
||||
}
|
||||
|
||||
std::string lua_get_zone_note(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneNote(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneNote(zone_id, version);
|
||||
}
|
||||
|
||||
float lua_get_zone_underworld(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneUnderworld(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneUnderworld(zone_id);
|
||||
}
|
||||
|
||||
float lua_get_zone_underworld(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneUnderworld(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneUnderworld(zone_id, version);
|
||||
}
|
||||
|
||||
float lua_get_zone_minimum_clip(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMinimumClip(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMinimumClip(zone_id);
|
||||
}
|
||||
|
||||
float lua_get_zone_minimum_clip(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMinimumClip(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMinimumClip(zone_id, version);
|
||||
}
|
||||
|
||||
float lua_get_zone_maximum_clip(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMaximumClip(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMaximumClip(zone_id);
|
||||
}
|
||||
|
||||
float lua_get_zone_maximum_clip(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMaximumClip(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMaximumClip(zone_id, version);
|
||||
}
|
||||
|
||||
float lua_get_zone_fog_minimum_clip(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFogMinimumClip(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFogMinimumClip(zone_id);
|
||||
}
|
||||
|
||||
float lua_get_zone_fog_minimum_clip(uint32 zone_id, uint8 slot)
|
||||
{
|
||||
return zone_store.GetZoneFogMinimumClip(zone_id, slot);
|
||||
return ZoneStore::Instance()->GetZoneFogMinimumClip(zone_id, slot);
|
||||
}
|
||||
|
||||
float lua_get_zone_fog_minimum_clip(uint32 zone_id, uint8 slot, int version)
|
||||
{
|
||||
return zone_store.GetZoneFogMinimumClip(zone_id, slot);
|
||||
return ZoneStore::Instance()->GetZoneFogMinimumClip(zone_id, slot);
|
||||
}
|
||||
|
||||
float lua_get_zone_fog_maximum_clip(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFogMaximumClip(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFogMaximumClip(zone_id);
|
||||
}
|
||||
|
||||
float lua_get_zone_fog_maximum_clip(uint32 zone_id, uint8 slot)
|
||||
{
|
||||
return zone_store.GetZoneFogMaximumClip(zone_id, slot);
|
||||
return ZoneStore::Instance()->GetZoneFogMaximumClip(zone_id, slot);
|
||||
}
|
||||
|
||||
float lua_get_zone_fog_maximum_clip(uint32 zone_id, uint8 slot, int version)
|
||||
{
|
||||
return zone_store.GetZoneFogMaximumClip(zone_id, slot, version);
|
||||
return ZoneStore::Instance()->GetZoneFogMaximumClip(zone_id, slot, version);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_fog_red(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFogRed(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFogRed(zone_id);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_fog_red(uint32 zone_id, uint8 slot)
|
||||
{
|
||||
return zone_store.GetZoneFogRed(zone_id, slot);
|
||||
return ZoneStore::Instance()->GetZoneFogRed(zone_id, slot);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_fog_red(uint32 zone_id, uint8 slot, int version)
|
||||
{
|
||||
return zone_store.GetZoneFogRed(zone_id, slot, version);
|
||||
return ZoneStore::Instance()->GetZoneFogRed(zone_id, slot, version);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_fog_green(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFogGreen(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFogGreen(zone_id);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_fog_green(uint32 zone_id, uint8 slot)
|
||||
{
|
||||
return zone_store.GetZoneFogGreen(zone_id, slot);
|
||||
return ZoneStore::Instance()->GetZoneFogGreen(zone_id, slot);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_fog_green(uint32 zone_id, uint8 slot, int version)
|
||||
{
|
||||
return zone_store.GetZoneFogGreen(zone_id, slot, version);
|
||||
return ZoneStore::Instance()->GetZoneFogGreen(zone_id, slot, version);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_fog_blue(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFogBlue(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFogBlue(zone_id);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_fog_blue(uint32 zone_id, uint8 slot)
|
||||
{
|
||||
return zone_store.GetZoneFogBlue(zone_id, slot);
|
||||
return ZoneStore::Instance()->GetZoneFogBlue(zone_id, slot);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_fog_blue(uint32 zone_id, uint8 slot, int version)
|
||||
{
|
||||
return zone_store.GetZoneFogBlue(zone_id, slot, version);
|
||||
return ZoneStore::Instance()->GetZoneFogBlue(zone_id, slot, version);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_sky(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSky(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneSky(zone_id);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_sky(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSky(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneSky(zone_id, version);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_ztype(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneZType(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneZType(zone_id);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_ztype(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneZType(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneZType(zone_id, version);
|
||||
}
|
||||
|
||||
float lua_get_zone_experience_multiplier(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneExperienceMultiplier(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneExperienceMultiplier(zone_id);
|
||||
}
|
||||
|
||||
float lua_get_zone_experience_multiplier(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneExperienceMultiplier(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneExperienceMultiplier(zone_id, version);
|
||||
}
|
||||
|
||||
float lua_get_zone_walk_speed(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneWalkSpeed(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneWalkSpeed(zone_id);
|
||||
}
|
||||
|
||||
float lua_get_zone_walk_speed(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneWalkSpeed(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneWalkSpeed(zone_id, version);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_time_type(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneTimeType(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneTimeType(zone_id);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_time_type(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneTimeType(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneTimeType(zone_id, version);
|
||||
}
|
||||
|
||||
float lua_get_zone_fog_density(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFogDensity(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFogDensity(zone_id);
|
||||
}
|
||||
|
||||
float lua_get_zone_fog_density(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneFogDensity(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneFogDensity(zone_id, version);
|
||||
}
|
||||
|
||||
std::string lua_get_zone_flag_needed(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFlagNeeded(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFlagNeeded(zone_id);
|
||||
}
|
||||
|
||||
std::string lua_get_zone_flag_needed(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneFlagNeeded(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneFlagNeeded(zone_id, version);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_can_bind(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneCanBind(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneCanBind(zone_id);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_can_bind(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneCanBind(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneCanBind(zone_id, version);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_can_combat(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneCanCombat(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneCanCombat(zone_id);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_can_combat(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneCanCombat(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneCanCombat(zone_id, version);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_can_levitate(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneCanLevitate(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneCanLevitate(zone_id);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_can_levitate(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneCanLevitate(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneCanLevitate(zone_id, version);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_cast_outdoor(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneCastOutdoor(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneCastOutdoor(zone_id);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_cast_outdoor(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneCastOutdoor(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneCastOutdoor(zone_id, version);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_hotzone(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneHotzone(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneHotzone(zone_id);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_hotzone(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneHotzone(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneHotzone(zone_id, version);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_instance_type(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneInstanceType(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneInstanceType(zone_id);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_instance_type(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneInstanceType(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneInstanceType(zone_id, version);
|
||||
}
|
||||
|
||||
uint64 lua_get_zone_shutdown_delay(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneShutdownDelay(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneShutdownDelay(zone_id);
|
||||
}
|
||||
|
||||
uint64 lua_get_zone_shutdown_delay(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneShutdownDelay(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneShutdownDelay(zone_id, version);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_peqzone(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZonePEQZone(zone_id);
|
||||
return ZoneStore::Instance()->GetZonePEQZone(zone_id);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_peqzone(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZonePEQZone(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZonePEQZone(zone_id, version);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_expansion(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneExpansion(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneExpansion(zone_id);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_expansion(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneExpansion(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneExpansion(zone_id, version);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_bypass_expansion_check(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneBypassExpansionCheck(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneBypassExpansionCheck(zone_id);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_bypass_expansion_check(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneBypassExpansionCheck(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneBypassExpansionCheck(zone_id, version);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_suspend_buffs(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSuspendBuffs(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneSuspendBuffs(zone_id);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_suspend_buffs(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSuspendBuffs(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneSuspendBuffs(zone_id, version);
|
||||
}
|
||||
|
||||
int lua_get_zone_rain_chance(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneRainChance(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneRainChance(zone_id);
|
||||
}
|
||||
|
||||
int lua_get_zone_rain_chance(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneRainChance(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneRainChance(zone_id, version);
|
||||
}
|
||||
|
||||
int lua_get_zone_rain_duration(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneRainDuration(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneRainDuration(zone_id);
|
||||
}
|
||||
|
||||
int lua_get_zone_rain_duration(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneRainDuration(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneRainDuration(zone_id, version);
|
||||
}
|
||||
|
||||
int lua_get_zone_snow_chance(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSnowChance(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneSnowChance(zone_id);
|
||||
}
|
||||
|
||||
int lua_get_zone_snow_chance(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSnowChance(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneSnowChance(zone_id, version);
|
||||
}
|
||||
|
||||
int lua_get_zone_snow_duration(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSnowDuration(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneSnowDuration(zone_id);
|
||||
}
|
||||
|
||||
int lua_get_zone_snow_duration(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSnowDuration(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneSnowDuration(zone_id, version);
|
||||
}
|
||||
|
||||
float lua_get_zone_gravity(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneGravity(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneGravity(zone_id);
|
||||
}
|
||||
|
||||
float lua_get_zone_gravity(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneGravity(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneGravity(zone_id, version);
|
||||
}
|
||||
|
||||
int lua_get_zone_type(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneType(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneType(zone_id);
|
||||
}
|
||||
|
||||
int lua_get_zone_type(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneType(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneType(zone_id, version);
|
||||
}
|
||||
|
||||
int lua_get_zone_sky_lock(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSkyLock(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneSkyLock(zone_id);
|
||||
}
|
||||
|
||||
int lua_get_zone_sky_lock(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSkyLock(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneSkyLock(zone_id, version);
|
||||
}
|
||||
|
||||
int lua_get_zone_fast_regen_hp(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFastRegenHP(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFastRegenHP(zone_id);
|
||||
}
|
||||
|
||||
int lua_get_zone_fast_regen_hp(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneFastRegenHP(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneFastRegenHP(zone_id, version);
|
||||
}
|
||||
|
||||
int lua_get_zone_fast_regen_mana(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFastRegenMana(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFastRegenMana(zone_id);
|
||||
}
|
||||
|
||||
int lua_get_zone_fast_regen_mana(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneFastRegenMana(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneFastRegenMana(zone_id, version);
|
||||
}
|
||||
|
||||
int lua_get_zone_fast_regen_endurance(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneFastRegenEndurance(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneFastRegenEndurance(zone_id);
|
||||
}
|
||||
|
||||
int lua_get_zone_fast_regen_endurance(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneFastRegenEndurance(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneFastRegenEndurance(zone_id, version);
|
||||
}
|
||||
|
||||
int lua_get_zone_npc_maximum_aggro_distance(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneNPCMaximumAggroDistance(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneNPCMaximumAggroDistance(zone_id);
|
||||
}
|
||||
|
||||
int lua_get_zone_npc_maximum_aggro_distance(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneNPCMaximumAggroDistance(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneNPCMaximumAggroDistance(zone_id, version);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_minimum_expansion(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMinimumExpansion(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMinimumExpansion(zone_id);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_minimum_expansion(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMinimumExpansion(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMinimumExpansion(zone_id, version);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_maximum_expansion(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMaximumExpansion(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMaximumExpansion(zone_id);
|
||||
}
|
||||
|
||||
int8 lua_get_zone_maximum_expansion(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMaximumExpansion(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMaximumExpansion(zone_id, version);
|
||||
}
|
||||
|
||||
std::string lua_get_zone_content_flags(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneContentFlags(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneContentFlags(zone_id);
|
||||
}
|
||||
|
||||
std::string lua_get_zone_content_flags(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneContentFlags(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneContentFlags(zone_id, version);
|
||||
}
|
||||
|
||||
std::string lua_get_zone_content_flags_disabled(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneContentFlagsDisabled(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneContentFlagsDisabled(zone_id);
|
||||
}
|
||||
|
||||
std::string lua_get_zone_content_flags_disabled(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneContentFlagsDisabled(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneContentFlagsDisabled(zone_id, version);
|
||||
}
|
||||
|
||||
int lua_get_zone_underworld_teleport_index(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneUnderworldTeleportIndex(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneUnderworldTeleportIndex(zone_id);
|
||||
}
|
||||
|
||||
int lua_get_zone_underworld_teleport_index(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneUnderworldTeleportIndex(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneUnderworldTeleportIndex(zone_id, version);
|
||||
}
|
||||
|
||||
int lua_get_zone_lava_damage(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneLavaDamage(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneLavaDamage(zone_id);
|
||||
}
|
||||
|
||||
int lua_get_zone_lava_damage(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneLavaDamage(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneLavaDamage(zone_id, version);
|
||||
}
|
||||
|
||||
int lua_get_zone_minimum_lava_damage(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneMinimumLavaDamage(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneMinimumLavaDamage(zone_id);
|
||||
}
|
||||
|
||||
int lua_get_zone_minimum_lava_damage(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneMinimumLavaDamage(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneMinimumLavaDamage(zone_id, version);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_idle_when_empty(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneIdleWhenEmpty(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneIdleWhenEmpty(zone_id);
|
||||
}
|
||||
|
||||
uint8 lua_get_zone_idle_when_empty(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneIdleWhenEmpty(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneIdleWhenEmpty(zone_id, version);
|
||||
}
|
||||
|
||||
uint32 lua_get_zone_seconds_before_idle(uint32 zone_id)
|
||||
{
|
||||
return zone_store.GetZoneSecondsBeforeIdle(zone_id);
|
||||
return ZoneStore::Instance()->GetZoneSecondsBeforeIdle(zone_id);
|
||||
}
|
||||
|
||||
uint32 lua_get_zone_seconds_before_idle(uint32 zone_id, int version)
|
||||
{
|
||||
return zone_store.GetZoneSecondsBeforeIdle(zone_id, version);
|
||||
return ZoneStore::Instance()->GetZoneSecondsBeforeIdle(zone_id, version);
|
||||
}
|
||||
|
||||
void lua_send_channel_message(uint8 channel_number, uint32 guild_id, uint8 language_id, uint8 language_skill, const char* message)
|
||||
@@ -5497,11 +5505,11 @@ bool lua_set_auto_login_character_name_by_account_id(uint32 account_id, std::str
|
||||
}
|
||||
|
||||
uint32 lua_get_zone_id_by_long_name(std::string zone_long_name) {
|
||||
return zone_store.GetZoneIDByLongName(zone_long_name);
|
||||
return ZoneStore::Instance()->GetZoneIDByLongName(zone_long_name);
|
||||
}
|
||||
|
||||
std::string lua_get_zone_short_name_by_long_name(std::string zone_long_name) {
|
||||
return zone_store.GetZoneShortNameByLongName(zone_long_name);
|
||||
return ZoneStore::Instance()->GetZoneShortNameByLongName(zone_long_name);
|
||||
}
|
||||
|
||||
bool lua_send_parcel(luabind::object lua_table)
|
||||
@@ -5970,6 +5978,8 @@ luabind::scope lua_register_general() {
|
||||
luabind::def("reset_task_activity", &lua_reset_task_activity),
|
||||
luabind::def("assign_task", &lua_assign_task),
|
||||
luabind::def("fail_task", &lua_fail_task),
|
||||
luabind::def("complete_task", &lua_complete_task),
|
||||
luabind::def("uncomplete_task", &lua_uncomplete_task),
|
||||
luabind::def("task_time_left", &lua_task_time_left),
|
||||
luabind::def("is_task_completed", &lua_is_task_completed),
|
||||
luabind::def("enabled_task_count", &lua_enabled_task_count),
|
||||
@@ -7963,33 +7973,6 @@ luabind::scope lua_register_languages() {
|
||||
)];
|
||||
}
|
||||
|
||||
luabind::scope lua_register_rules_const() {
|
||||
return luabind::class_<Rule>("Rule")
|
||||
.enum_("constants")
|
||||
[(
|
||||
#define RULE_INT(cat, rule, default_value, notes) \
|
||||
luabind::value(#rule, RuleManager::Int__##rule),
|
||||
#include "../common/ruletypes.h"
|
||||
luabind::value("_IntRuleCount", RuleManager::_IntRuleCount),
|
||||
#undef RULE_INT
|
||||
#define RULE_REAL(cat, rule, default_value, notes) \
|
||||
luabind::value(#rule, RuleManager::Real__##rule),
|
||||
#include "../common/ruletypes.h"
|
||||
luabind::value("_RealRuleCount", RuleManager::_RealRuleCount),
|
||||
#undef RULE_REAL
|
||||
#define RULE_BOOL(cat, rule, default_value, notes) \
|
||||
luabind::value(#rule, RuleManager::Bool__##rule),
|
||||
#include "../common/ruletypes.h"
|
||||
luabind::value("_BoolRuleCount", RuleManager::_BoolRuleCount),
|
||||
#undef RULE_BOOL
|
||||
#define RULE_STRING(cat, rule, default_value, notes) \
|
||||
luabind::value(#rule, RuleManager::String__##rule),
|
||||
#include "../common/ruletypes.h"
|
||||
luabind::value("_StringRuleCount", RuleManager::_StringRuleCount)
|
||||
#undef RULE_STRING
|
||||
)];
|
||||
}
|
||||
|
||||
luabind::scope lua_register_rulei() {
|
||||
return luabind::namespace_("RuleI")
|
||||
[
|
||||
|
||||
+6
-7
@@ -1070,7 +1070,7 @@ void LuaParser::ReloadQuests() {
|
||||
std::string module_path = lua_tostring(L, -1);
|
||||
lua_pop(L, 1);
|
||||
|
||||
for (const auto& dir : path.GetLuaModulePaths()) {
|
||||
for (const auto& dir : PathManager::Instance()->GetLuaModulePaths()) {
|
||||
module_path += fmt::format(";{}/?.lua", dir);
|
||||
module_path += fmt::format(";{}/?/init.lua", dir);
|
||||
module_path += fmt::format(";{}/share/lua/{}/?.lua", dir, lua_version);
|
||||
@@ -1086,7 +1086,7 @@ void LuaParser::ReloadQuests() {
|
||||
module_path = lua_tostring(L, -1);
|
||||
lua_pop(L, 1);
|
||||
|
||||
for (const auto& dir : path.GetLuaModulePaths()) {
|
||||
for (const auto& dir : PathManager::Instance()->GetLuaModulePaths()) {
|
||||
module_path += fmt::format(";{}/?{}", dir, libext);
|
||||
module_path += fmt::format(";{}/lib/lua/{}/?{}", dir, lua_version, libext);
|
||||
}
|
||||
@@ -1098,7 +1098,7 @@ void LuaParser::ReloadQuests() {
|
||||
MapFunctions(L);
|
||||
|
||||
// load init
|
||||
for (auto& dir : path.GetQuestPaths()) {
|
||||
for (auto& dir : PathManager::Instance()->GetQuestPaths()) {
|
||||
std::string filename = fmt::format("{}/{}/script_init.lua", dir, QUEST_GLOBAL_DIRECTORY);
|
||||
|
||||
FILE* f = fopen(filename.c_str(), "r");
|
||||
@@ -1114,7 +1114,7 @@ void LuaParser::ReloadQuests() {
|
||||
|
||||
//zone init - always loads after global
|
||||
if (zone) {
|
||||
for (auto& dir : path.GetQuestPaths()) {
|
||||
for (auto& dir : PathManager::Instance()->GetQuestPaths()) {
|
||||
std::string zone_script = fmt::format(
|
||||
"{}/{}/script_init_v{}.lua",
|
||||
dir,
|
||||
@@ -1147,7 +1147,7 @@ void LuaParser::ReloadQuests() {
|
||||
}
|
||||
}
|
||||
|
||||
FILE *load_order = fopen(fmt::format("{}/load_order.txt", path.GetLuaModsPath()).c_str(), "r");
|
||||
FILE *load_order = fopen(fmt::format("{}/load_order.txt", PathManager::Instance()->GetLuaModsPath()).c_str(), "r");
|
||||
if (load_order) {
|
||||
char file_name[256] = { 0 };
|
||||
while (fgets(file_name, 256, load_order) != nullptr) {
|
||||
@@ -1159,7 +1159,7 @@ void LuaParser::ReloadQuests() {
|
||||
}
|
||||
}
|
||||
|
||||
LoadScript(fmt::format("{}/{}", path.GetLuaModsPath(), std::string(file_name)), file_name);
|
||||
LoadScript(fmt::format("{}/{}", PathManager::Instance()->GetLuaModsPath(), std::string(file_name)), file_name);
|
||||
mods_.emplace_back(L, this, file_name);
|
||||
}
|
||||
|
||||
@@ -1320,7 +1320,6 @@ void LuaParser::MapFunctions(lua_State *L) {
|
||||
lua_register_packet(),
|
||||
lua_register_packet_opcodes(),
|
||||
lua_register_stat_bonuses(),
|
||||
lua_register_rules_const(),
|
||||
lua_register_rulei(),
|
||||
lua_register_ruler(),
|
||||
lua_register_ruleb(),
|
||||
|
||||
+52
-53
@@ -4,7 +4,6 @@
|
||||
|
||||
#include <luabind/luabind.hpp>
|
||||
#include "../common/global_define.h"
|
||||
#include "embperl.h"
|
||||
#include "lua_zone.h"
|
||||
|
||||
bool Lua_Zone::BuffTimersSuspended()
|
||||
@@ -16,7 +15,7 @@ bool Lua_Zone::BuffTimersSuspended()
|
||||
bool Lua_Zone::BypassesExpansionCheck()
|
||||
{
|
||||
Lua_Safe_Call_Bool();
|
||||
return zone_store.GetZoneBypassExpansionCheck(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneBypassExpansionCheck(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
bool Lua_Zone::CanBind()
|
||||
@@ -88,25 +87,25 @@ float Lua_Zone::GetAAEXPModifierByCharacterID(uint32 character_id)
|
||||
std::string Lua_Zone::GetContentFlags()
|
||||
{
|
||||
Lua_Safe_Call_String();
|
||||
return zone_store.GetZoneContentFlags(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneContentFlags(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
std::string Lua_Zone::GetContentFlagsDisabled()
|
||||
{
|
||||
Lua_Safe_Call_String();
|
||||
return zone_store.GetZoneContentFlagsDisabled(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneContentFlagsDisabled(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Lua_Zone::GetExperienceMultiplier()
|
||||
{
|
||||
Lua_Safe_Call_Real();
|
||||
return zone_store.GetZoneExperienceMultiplier(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneExperienceMultiplier(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int8 Lua_Zone::GetExpansion()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Lua_Zone::GetEXPModifier(Lua_Client c)
|
||||
@@ -124,19 +123,19 @@ float Lua_Zone::GetEXPModifierByCharacterID(uint32 character_id)
|
||||
int Lua_Zone::GetFastRegenEndurance()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneFastRegenEndurance(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFastRegenEndurance(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Lua_Zone::GetFastRegenHP()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneFastRegenHP(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFastRegenHP(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Lua_Zone::GetFastRegenMana()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneFastRegenMana(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFastRegenMana(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
std::string Lua_Zone::GetFileName()
|
||||
@@ -148,73 +147,73 @@ std::string Lua_Zone::GetFileName()
|
||||
std::string Lua_Zone::GetFlagNeeded()
|
||||
{
|
||||
Lua_Safe_Call_String();
|
||||
return zone_store.GetZoneFlagNeeded(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFlagNeeded(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Lua_Zone::GetFogBlue()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneFogBlue(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFogBlue(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Lua_Zone::GetFogBlue(uint8 slot)
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneFogBlue(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFogBlue(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Lua_Zone::GetFogDensity()
|
||||
{
|
||||
Lua_Safe_Call_Real();
|
||||
return zone_store.GetZoneFogDensity(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFogDensity(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Lua_Zone::GetFogGreen()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneFogGreen(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFogGreen(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Lua_Zone::GetFogGreen(uint8 slot)
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneFogGreen(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFogGreen(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Lua_Zone::GetFogMaximumClip()
|
||||
{
|
||||
Lua_Safe_Call_Real();
|
||||
return zone_store.GetZoneFogMaximumClip(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFogMaximumClip(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Lua_Zone::GetFogMaximumClip(uint8 slot)
|
||||
{
|
||||
Lua_Safe_Call_Real();
|
||||
return zone_store.GetZoneFogMaximumClip(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFogMaximumClip(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Lua_Zone::GetFogMinimumClip()
|
||||
{
|
||||
Lua_Safe_Call_Real();
|
||||
return zone_store.GetZoneFogMinimumClip(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFogMinimumClip(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Lua_Zone::GetFogMinimumClip(uint8 slot)
|
||||
{
|
||||
Lua_Safe_Call_Real();
|
||||
return zone_store.GetZoneFogMinimumClip(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFogMinimumClip(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Lua_Zone::GetFogRed()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneFogRed(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFogRed(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Lua_Zone::GetFogRed(uint8 slot)
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneFogRed(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFogRed(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Lua_Zone::GetGraveyardHeading()
|
||||
@@ -256,7 +255,7 @@ uint32 Lua_Zone::GetGraveyardZoneID()
|
||||
float Lua_Zone::GetGravity()
|
||||
{
|
||||
Lua_Safe_Call_Real();
|
||||
return zone_store.GetZoneGravity(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneGravity(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint32 Lua_Zone::GetInstanceID()
|
||||
@@ -268,7 +267,7 @@ uint32 Lua_Zone::GetInstanceID()
|
||||
uint8 Lua_Zone::GetInstanceType()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneInstanceType(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneInstanceType(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint16 Lua_Zone::GetInstanceVersion()
|
||||
@@ -286,7 +285,7 @@ uint32 Lua_Zone::GetInstanceTimeRemaining()
|
||||
int Lua_Zone::GetLavaDamage()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneLavaDamage(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneLavaDamage(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
std::string Lua_Zone::GetLongName()
|
||||
@@ -298,19 +297,19 @@ std::string Lua_Zone::GetLongName()
|
||||
float Lua_Zone::GetMaximumClip()
|
||||
{
|
||||
Lua_Safe_Call_Real();
|
||||
return zone_store.GetZoneMaximumClip(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneMaximumClip(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int8 Lua_Zone::GetMaximumExpansion()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneMaximumExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneMaximumExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Lua_Zone::GetMaximumLevel()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneMaximumLevel(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneMaximumLevel(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint32 Lua_Zone::GetMaxClients()
|
||||
@@ -322,79 +321,79 @@ uint32 Lua_Zone::GetMaxClients()
|
||||
float Lua_Zone::GetMinimumClip()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneMinimumClip(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneMinimumClip(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int8 Lua_Zone::GetMinimumExpansion()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneMinimumExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneMinimumExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Lua_Zone::GetMinimumLevel()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneMinimumLevel(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneMinimumLevel(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Lua_Zone::GetMinimumLavaDamage()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneMinimumLavaDamage(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneMinimumLavaDamage(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Lua_Zone::GetMinimumStatus()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneMinimumStatus(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneMinimumStatus(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
std::string Lua_Zone::GetNote()
|
||||
{
|
||||
Lua_Safe_Call_String();
|
||||
return zone_store.GetZoneNote(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneNote(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Lua_Zone::GetNPCMaximumAggroDistance()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneNPCMaximumAggroDistance(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneNPCMaximumAggroDistance(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int8 Lua_Zone::GetPEQZone()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZonePEQZone(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZonePEQZone(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Lua_Zone::GetRainChance()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneRainChance(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneRainChance(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Lua_Zone::GetRainChance(uint8 slot)
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneRainChance(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneRainChance(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Lua_Zone::GetRainDuration()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneRainDuration(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneRainDuration(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Lua_Zone::GetRainDuration(uint8 slot)
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneRainDuration(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneRainDuration(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint32 Lua_Zone::GetRuleSet()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneRuleSet(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneRuleSet(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Lua_Zone::GetSafeHeading()
|
||||
@@ -436,55 +435,55 @@ uint32 Lua_Zone::GetSecondsBeforeIdle()
|
||||
uint64 Lua_Zone::GetShutdownDelay()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneShutdownDelay(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneShutdownDelay(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Lua_Zone::GetSky()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneSky(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneSky(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int8 Lua_Zone::GetSkyLock()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneSkyLock(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneSkyLock(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Lua_Zone::GetSnowChance()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneSnowChance(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneSnowChance(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Lua_Zone::GetSnowChance(uint8 slot)
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneSnowChance(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneSnowChance(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Lua_Zone::GetSnowDuration()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneSnowDuration(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneSnowDuration(self->GetZoneID(), 0, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Lua_Zone::GetSnowDuration(uint8 slot)
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneSnowDuration(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneSnowDuration(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Lua_Zone::GetTimeType()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneTimeType(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneTimeType(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Lua_Zone::GetTimeZone()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneTimeZone(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneTimeZone(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
std::string Lua_Zone::GetZoneDescription()
|
||||
@@ -508,25 +507,25 @@ uint8 Lua_Zone::GetZoneType()
|
||||
float Lua_Zone::GetUnderworld()
|
||||
{
|
||||
Lua_Safe_Call_Real();
|
||||
return zone_store.GetZoneUnderworld(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneUnderworld(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Lua_Zone::GetUnderworldTeleportIndex()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneUnderworldTeleportIndex(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneUnderworldTeleportIndex(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Lua_Zone::GetWalkSpeed()
|
||||
{
|
||||
Lua_Safe_Call_Real();
|
||||
return zone_store.GetZoneWalkSpeed(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneWalkSpeed(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Lua_Zone::GetZoneZType()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return zone_store.GetZoneZType(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneZType(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Lua_Zone::GetZoneTotalBlockedSpells()
|
||||
|
||||
+7
-13
@@ -93,7 +93,6 @@ extern volatile bool is_zone_loaded;
|
||||
|
||||
EntityList entity_list;
|
||||
WorldServer worldserver;
|
||||
ZoneStore zone_store;
|
||||
uint32 numclients = 0;
|
||||
char errorname[32];
|
||||
extern Zone *zone;
|
||||
@@ -101,15 +100,12 @@ extern Zone *zone;
|
||||
npcDecayTimes_Struct npcCorpseDecayTimes[100];
|
||||
TitleManager title_manager;
|
||||
QueryServ *QServ = 0;
|
||||
TaskManager *task_manager = 0;
|
||||
NpcScaleManager *npc_scale_manager;
|
||||
QuestParserCollection *parse = 0;
|
||||
EQEmuLogSys LogSys;
|
||||
ZoneEventScheduler event_scheduler;
|
||||
WorldContentService content_service;
|
||||
PathManager path;
|
||||
PlayerEventLogs player_event_logs;
|
||||
SkillCaps skill_caps;
|
||||
EvolvingItemsManager evolving_items_manager;
|
||||
|
||||
const SPDat_Spell_Struct* spells;
|
||||
@@ -136,7 +132,7 @@ int main(int argc, char **argv)
|
||||
LogSys.SilenceConsoleLogging();
|
||||
}
|
||||
|
||||
path.LoadPaths();
|
||||
PathManager::Instance()->Init();
|
||||
|
||||
#ifdef USE_MAP_MMFS
|
||||
if (argc == 3 && strcasecmp(argv[1], "convert_map") == 0) {
|
||||
@@ -304,7 +300,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
LogSys.SetDatabase(&database)
|
||||
->SetLogPath(path.GetLogPath())
|
||||
->SetLogPath(PathManager::Instance()->GetLogPath())
|
||||
->LoadLogDatabaseSettings(ZoneCLI::RanTestCommand(argc, argv))
|
||||
->SetGMSayHandler(&Zone::GMSayHookCallBackProcess)
|
||||
->StartFileLogs();
|
||||
@@ -315,7 +311,7 @@ int main(int argc, char **argv)
|
||||
|
||||
player_event_logs.SetDatabase(&database)->Init();
|
||||
|
||||
skill_caps.SetContentDatabase(&content_db)->LoadSkillCaps();
|
||||
SkillCaps::Instance()->SetContentDatabase(&content_db)->LoadSkillCaps();
|
||||
|
||||
const auto c = EQEmuConfig::get();
|
||||
if (c->auto_database_updates) {
|
||||
@@ -366,9 +362,9 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
zone_store.LoadZones(content_db);
|
||||
ZoneStore::Instance()->LoadZones(content_db);
|
||||
|
||||
if (zone_store.GetZones().empty()) {
|
||||
if (ZoneStore::Instance()->GetZones().empty()) {
|
||||
LogError("Failed to load zones data, check your schema for possible errors");
|
||||
return 1;
|
||||
}
|
||||
@@ -449,8 +445,7 @@ int main(int argc, char **argv)
|
||||
npc_scale_manager->LoadScaleData();
|
||||
|
||||
if (RuleB(TaskSystem, EnableTaskSystem)) {
|
||||
task_manager = new TaskManager;
|
||||
task_manager->LoadTasks();
|
||||
TaskManager::Instance()->LoadTasks();
|
||||
}
|
||||
|
||||
parse = new QuestParserCollection();
|
||||
@@ -681,7 +676,6 @@ int main(int argc, char **argv)
|
||||
zone->Shutdown(true);
|
||||
}
|
||||
//Fix for Linux world server problem.
|
||||
safe_delete(task_manager);
|
||||
safe_delete(npc_scale_manager);
|
||||
command_deinit();
|
||||
bot_command_deinit();
|
||||
@@ -751,7 +745,7 @@ bool CheckForCompatibleQuestPlugins()
|
||||
|
||||
try {
|
||||
for (const auto &[directory, flag]: directories) {
|
||||
std::string dir_path = path.GetServerPath() + "/" + directory;
|
||||
std::string dir_path = PathManager::Instance()->GetServerPath() + "/" + directory;
|
||||
if (!File::Exists(dir_path)) { continue; }
|
||||
|
||||
for (const auto &file: fs::directory_iterator(dir_path)) {
|
||||
|
||||
+1
-1
@@ -271,7 +271,7 @@ bool Map::DoCollisionCheck(glm::vec3 myloc, glm::vec3 oloc, glm::vec3 &outnorm,
|
||||
|
||||
Map *Map::LoadMapFile(std::string file) {
|
||||
std::transform(file.begin(), file.end(), file.begin(), ::tolower);
|
||||
std::string filename = fmt::format("{}/base/{}.map", path.GetMapsPath(), file);
|
||||
std::string filename = fmt::format("{}/base/{}.map", PathManager::Instance()->GetMapsPath(), file);
|
||||
|
||||
LogInfo("Attempting to load Map File [{}]", filename.c_str());
|
||||
|
||||
|
||||
+3
-3
@@ -67,7 +67,7 @@ Merc::Merc(const NPCType* d, float x, float y, float z, float heading)
|
||||
|
||||
int r;
|
||||
for (r = 0; r <= EQ::skills::HIGHEST_SKILL; r++) {
|
||||
skills[r] = skill_caps.GetSkillCap(GetClass(), (EQ::skills::SkillType)r, GetLevel()).cap;
|
||||
skills[r] = SkillCaps::Instance()->GetSkillCap(GetClass(), (EQ::skills::SkillType)r, GetLevel()).cap;
|
||||
}
|
||||
|
||||
size = d->size;
|
||||
@@ -774,12 +774,12 @@ bool Merc::HasSkill(EQ::skills::SkillType skill_id) const {
|
||||
}
|
||||
|
||||
bool Merc::CanHaveSkill(EQ::skills::SkillType skill_id) const {
|
||||
return skill_caps.GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)).cap > 0;
|
||||
return SkillCaps::Instance()->GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)).cap > 0;
|
||||
//if you don't have it by max level, then odds are you never will?
|
||||
}
|
||||
|
||||
uint16 Merc::MaxSkill(EQ::skills::SkillType skillid, uint16 class_, uint16 level) const {
|
||||
return skill_caps.GetSkillCap(class_, skillid, level).cap;
|
||||
return SkillCaps::Instance()->GetSkillCap(class_, skillid, level).cap;
|
||||
}
|
||||
|
||||
void Merc::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
|
||||
@@ -208,6 +208,10 @@ public:
|
||||
Timer m_see_close_mobs_timer;
|
||||
Timer m_mob_check_moving_timer;
|
||||
|
||||
uint16 m_last_wearchange_race_id = 0;
|
||||
// client_id -> slot_id -> key
|
||||
std::unordered_map<uint32_t, std::unordered_map<uint8_t, uint64_t>> m_last_seen_wearchange;
|
||||
|
||||
// Bot attack flag
|
||||
Timer bot_attack_flag_timer;
|
||||
|
||||
|
||||
+44
-8
@@ -381,10 +381,6 @@ void Mob::SendWearChange(uint8 material_slot, Client *one_client)
|
||||
auto packet = new EQApplicationPacket(OP_WearChange, sizeof(WearChange_Struct));
|
||||
auto w = (WearChange_Struct *) packet->pBuffer;
|
||||
|
||||
Log(Logs::Detail, Logs::MobAppearance, "[%s]",
|
||||
GetCleanName()
|
||||
);
|
||||
|
||||
w->spawn_id = GetID();
|
||||
w->material = static_cast<uint32>(GetEquipmentMaterial(material_slot));
|
||||
w->elite_material = IsEliteMaterialItem(material_slot);
|
||||
@@ -399,10 +395,50 @@ void Mob::SendWearChange(uint8 material_slot, Client *one_client)
|
||||
|
||||
w->wear_slot_id = material_slot;
|
||||
|
||||
if (!one_client) {
|
||||
entity_list.QueueClients(this, packet);
|
||||
} else {
|
||||
one_client->QueuePacket(packet, false, Client::CLIENT_CONNECTED);
|
||||
if (GetRace() != m_last_wearchange_race_id) {
|
||||
m_last_seen_wearchange.clear();
|
||||
m_last_wearchange_race_id = GetRace();
|
||||
}
|
||||
|
||||
// this is a hash-like key to deduplicate packets sent to clients
|
||||
// it includes spawn_id, material, elite_material, hero_forge_model, wear_slot_id, and color
|
||||
// we send an enormous amount of wearchange packets in brute-force fashion and this is a low cost way to deduplicate them
|
||||
// we could remove all the extra wearchanges at the expense of tracing down intermittent visual bugs over a long time
|
||||
auto build_key = [&](const WearChange_Struct& s) -> uint64_t {
|
||||
uint64_t key = 0;
|
||||
|
||||
key |= static_cast<uint64_t>(s.material & 0xFFF) << 0; // 12 bits
|
||||
key |= static_cast<uint64_t>(s.elite_material & 0x1) << 12; // 1 bit
|
||||
key |= static_cast<uint64_t>(s.hero_forge_model & 0xFFFFF) << 13; // 20 bits
|
||||
key |= static_cast<uint64_t>(GetRace() & 0xFFFF) << 33; // 16 bits
|
||||
|
||||
// Optional: Fold in color for appearance differences
|
||||
uint8_t folded_color = static_cast<uint8_t>(
|
||||
(s.color.Color * 17ull) & 0xFF
|
||||
);
|
||||
key |= static_cast<uint64_t>(folded_color) << 49;
|
||||
|
||||
return key;
|
||||
};
|
||||
|
||||
|
||||
auto dedupe_key = build_key(*w);
|
||||
auto send_if_changed = [&](Client* client) {
|
||||
auto& last_key = m_last_seen_wearchange[client->GetID()][material_slot];
|
||||
if (last_key == dedupe_key) {
|
||||
return;
|
||||
}
|
||||
last_key = dedupe_key;
|
||||
client->QueuePacket(packet, true, Client::CLIENT_CONNECTED);
|
||||
};
|
||||
|
||||
if (one_client) {
|
||||
send_if_changed(one_client);
|
||||
}
|
||||
else {
|
||||
for (auto& [_, client] : entity_list.GetClientList()) {
|
||||
send_if_changed(client);
|
||||
}
|
||||
}
|
||||
|
||||
safe_delete(packet);
|
||||
|
||||
+2
-2
@@ -370,7 +370,7 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
|
||||
//give NPCs skill values...
|
||||
int r;
|
||||
for (r = 0; r <= EQ::skills::HIGHEST_SKILL; r++) {
|
||||
skills[r] = skill_caps.GetSkillCap(GetClass(), (EQ::skills::SkillType)r, moblevel).cap;
|
||||
skills[r] = SkillCaps::Instance()->GetSkillCap(GetClass(), (EQ::skills::SkillType)r, moblevel).cap;
|
||||
}
|
||||
// some overrides -- really we need to be able to set skills for mobs in the DB
|
||||
// There are some known low level SHM/BST pets that do not follow this, which supports
|
||||
@@ -3726,7 +3726,7 @@ void NPC::RecalculateSkills()
|
||||
{
|
||||
int r;
|
||||
for (r = 0; r <= EQ::skills::HIGHEST_SKILL; r++) {
|
||||
skills[r] = skill_caps.GetSkillCap(GetClass(), (EQ::skills::SkillType)r, level).cap;
|
||||
skills[r] = SkillCaps::Instance()->GetSkillCap(GetClass(), (EQ::skills::SkillType)r, level).cap;
|
||||
}
|
||||
|
||||
// some overrides -- really we need to be able to set skills for mobs in the DB
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
IPathfinder *IPathfinder::Load(const std::string &zone) {
|
||||
struct stat statbuffer;
|
||||
std::string navmesh_path = fmt::format("{}/maps/nav/{}.nav", path.GetServerPath(), zone);
|
||||
std::string navmesh_path = fmt::format("{}/maps/nav/{}.nav", PathManager::Instance()->GetServerPath(), zone);
|
||||
if (stat(navmesh_path.c_str(), &statbuffer) == 0) {
|
||||
return new PathfinderNavmesh(navmesh_path);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "../merc.h"
|
||||
#include "../mob.h"
|
||||
#include "../npc.h"
|
||||
#include "../corpse.h"
|
||||
#include "../doors.h"
|
||||
#include "../bot.h"
|
||||
#include "../entity.h"
|
||||
#include "../client.h"
|
||||
#include "../zone.h"
|
||||
@@ -3336,6 +3336,16 @@ bool Perl_Client_KeyRingRemove(Client* self, uint32 item_id)
|
||||
return self->KeyRingRemove(item_id);
|
||||
}
|
||||
|
||||
bool Perl_Client_CompleteTask(Client* self, int task_id)
|
||||
{
|
||||
return self->CompleteTask(task_id);
|
||||
}
|
||||
|
||||
bool Perl_Client_UncompleteTask(Client* self, int task_id)
|
||||
{
|
||||
return self->UncompleteTask(task_id);
|
||||
}
|
||||
|
||||
void perl_register_client()
|
||||
{
|
||||
perl::interpreter perl(PERL_GET_THX);
|
||||
@@ -3418,6 +3428,7 @@ void perl_register_client()
|
||||
package.add("ClearPEQZoneFlag", &Perl_Client_ClearPEQZoneFlag);
|
||||
package.add("ClearXTargets", &Perl_Client_ClearXTargets);
|
||||
package.add("ClearZoneFlag", &Perl_Client_ClearZoneFlag);
|
||||
package.add("CompleteTask", &Perl_Client_CompleteTask);
|
||||
package.add("Connected", &Perl_Client_Connected);
|
||||
package.add("CountAugmentEquippedByID", &Perl_Client_CountAugmentEquippedByID);
|
||||
package.add("CountItem", &Perl_Client_CountItem);
|
||||
@@ -3909,6 +3920,7 @@ void perl_register_client()
|
||||
package.add("Thirsty", &Perl_Client_Thirsty);
|
||||
package.add("TrainDiscBySpellID", &Perl_Client_TrainDiscBySpellID);
|
||||
package.add("UnFreeze", &Perl_Client_UnFreeze);
|
||||
package.add("UncompleteTask", &Perl_Client_UncompleteTask);
|
||||
package.add("Undye", &Perl_Client_Undye);
|
||||
package.add("UnmemSpell", (void(*)(Client*, int))&Perl_Client_UnmemSpell);
|
||||
package.add("UnmemSpell", (void(*)(Client*, int, bool))&Perl_Client_UnmemSpell);
|
||||
|
||||
+43
-43
@@ -13,7 +13,7 @@ bool Perl_Zone_BuffTimersSuspended(Zone* self)
|
||||
|
||||
bool Perl_Zone_BypassesExpansionCheck(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneBypassExpansionCheck(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneBypassExpansionCheck(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
bool Perl_Zone_CanBind(Zone* self)
|
||||
@@ -73,22 +73,22 @@ float Perl_Zone_GetAAEXPModifierByCharacterID(Zone* self, uint32 character_id)
|
||||
|
||||
std::string Perl_Zone_GetContentFlags(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneContentFlags(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneContentFlags(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
std::string Perl_Zone_GetContentFlagsDisabled(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneContentFlagsDisabled(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneContentFlagsDisabled(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Perl_Zone_GetExperienceMultiplier(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneExperienceMultiplier(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneExperienceMultiplier(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int8 Perl_Zone_GetExpansion(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Perl_Zone_GetEXPModifier(Zone* self, Client* c)
|
||||
@@ -103,17 +103,17 @@ float Perl_Zone_GetEXPModifierByCharacterID(Zone* self, uint32 character_id)
|
||||
|
||||
int Perl_Zone_GetFastRegenEndurance(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneFastRegenEndurance(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFastRegenEndurance(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Perl_Zone_GetFastRegenHP(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneFastRegenHP(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFastRegenHP(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Perl_Zone_GetFastRegenMana(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneFastRegenMana(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFastRegenMana(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
std::string Perl_Zone_GetFileName(Zone* self)
|
||||
@@ -123,37 +123,37 @@ std::string Perl_Zone_GetFileName(Zone* self)
|
||||
|
||||
std::string Perl_Zone_GetFlagNeeded(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneFlagNeeded(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFlagNeeded(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Perl_Zone_GetFogBlue(Zone* self, uint8 slot = 0)
|
||||
{
|
||||
return zone_store.GetZoneFogBlue(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFogBlue(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Perl_Zone_GetFogDensity(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneFogDensity(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFogDensity(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Perl_Zone_GetFogGreen(Zone* self, uint8 slot = 0)
|
||||
{
|
||||
return zone_store.GetZoneFogGreen(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFogGreen(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Perl_Zone_GetFogMaximumClip(Zone* self, uint8 slot = 0)
|
||||
{
|
||||
return zone_store.GetZoneFogMaximumClip(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFogMaximumClip(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Perl_Zone_GetFogMinimumClip(Zone* self, uint8 slot = 0)
|
||||
{
|
||||
return zone_store.GetZoneFogMinimumClip(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFogMinimumClip(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Perl_Zone_GetFogRed(Zone* self, uint8 slot = 0)
|
||||
{
|
||||
return zone_store.GetZoneFogRed(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneFogRed(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Perl_Zone_GetGraveyardHeading(Zone* self)
|
||||
@@ -188,7 +188,7 @@ uint32 Perl_Zone_GetGraveyardZoneID(Zone* self)
|
||||
|
||||
float Perl_Zone_GetGravity(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneGravity(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneGravity(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint32 Perl_Zone_GetInstanceID(Zone* self)
|
||||
@@ -198,7 +198,7 @@ uint32 Perl_Zone_GetInstanceID(Zone* self)
|
||||
|
||||
uint8 Perl_Zone_GetInstanceType(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneInstanceType(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneInstanceType(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint16 Perl_Zone_GetInstanceVersion(Zone* self)
|
||||
@@ -213,7 +213,7 @@ uint32 Perl_Zone_GetInstanceTimeRemaining(Zone* self)
|
||||
|
||||
int Perl_Zone_GetLavaDamage(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneLavaDamage(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneLavaDamage(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
std::string Perl_Zone_GetLongName(Zone* self)
|
||||
@@ -223,17 +223,17 @@ std::string Perl_Zone_GetLongName(Zone* self)
|
||||
|
||||
float Perl_Zone_GetMaximumClip(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneMaximumClip(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneMaximumClip(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int8 Perl_Zone_GetMaximumExpansion(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneMaximumExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneMaximumExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Perl_Zone_GetMaximumLevel(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneMaximumLevel(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneMaximumLevel(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint32 Perl_Zone_GetMaxClients(Zone* self)
|
||||
@@ -243,57 +243,57 @@ uint32 Perl_Zone_GetMaxClients(Zone* self)
|
||||
|
||||
float Perl_Zone_GetMinimumClip(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneMinimumClip(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneMinimumClip(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int8 Perl_Zone_GetMinimumExpansion(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneMinimumExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneMinimumExpansion(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Perl_Zone_GetMinimumLevel(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneMinimumLevel(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneMinimumLevel(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Perl_Zone_GetMinimumLavaDamage(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneMinimumLavaDamage(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneMinimumLavaDamage(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Perl_Zone_GetMinimumStatus(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneMinimumStatus(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneMinimumStatus(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
std::string Perl_Zone_GetNote(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneNote(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneNote(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Perl_Zone_GetNPCMaximumAggroDistance(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneNPCMaximumAggroDistance(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneNPCMaximumAggroDistance(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int8 Perl_Zone_GetPEQZone(Zone* self)
|
||||
{
|
||||
return zone_store.GetZonePEQZone(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZonePEQZone(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Perl_Zone_GetRainChance(Zone* self, uint8 slot = 0)
|
||||
{
|
||||
return zone_store.GetZoneRainChance(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneRainChance(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Perl_Zone_GetRainDuration(Zone* self, uint8 slot = 0)
|
||||
{
|
||||
return zone_store.GetZoneRainDuration(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneRainDuration(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint32 Perl_Zone_GetRuleSet(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneRuleSet(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneRuleSet(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Perl_Zone_GetSafeHeading(Zone* self)
|
||||
@@ -328,37 +328,37 @@ uint32 Perl_Zone_GetSecondsBeforeIdle(Zone* self)
|
||||
|
||||
uint64 Perl_Zone_GetShutdownDelay(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneShutdownDelay(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneShutdownDelay(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Perl_Zone_GetSky(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneSky(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneSky(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int8 Perl_Zone_GetSkyLock(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneSkyLock(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneSkyLock(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Perl_Zone_GetSnowChance(Zone* self, uint8 slot = 0)
|
||||
{
|
||||
return zone_store.GetZoneSnowChance(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneSnowChance(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Perl_Zone_GetSnowDuration(Zone* self, uint8 slot = 0)
|
||||
{
|
||||
return zone_store.GetZoneSnowDuration(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneSnowDuration(self->GetZoneID(), slot, self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Perl_Zone_GetTimeType(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneTimeType(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneTimeType(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Perl_Zone_GetTimeZone(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneTimeZone(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneTimeZone(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
std::string Perl_Zone_GetZoneDescription(Zone* self)
|
||||
@@ -378,22 +378,22 @@ uint8 Perl_Zone_GetZoneType(Zone* self)
|
||||
|
||||
float Perl_Zone_GetUnderworld(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneUnderworld(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneUnderworld(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Perl_Zone_GetUnderworldTeleportIndex(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneUnderworldTeleportIndex(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneUnderworldTeleportIndex(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
float Perl_Zone_GetWalkSpeed(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneWalkSpeed(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneWalkSpeed(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
uint8 Perl_Zone_GetZoneZType(Zone* self)
|
||||
{
|
||||
return zone_store.GetZoneZType(self->GetZoneID(), self->GetInstanceVersion());
|
||||
return ZoneStore::Instance()->GetZoneZType(self->GetZoneID(), self->GetInstanceVersion());
|
||||
}
|
||||
|
||||
int Perl_Zone_GetZoneTotalBlockedSpells(Zone* self)
|
||||
|
||||
+1
-3
@@ -38,8 +38,6 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
#include "petitions.h"
|
||||
#include "worldserver.h"
|
||||
|
||||
PetitionList petition_list;
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
void Petition::SendPetitionToPlayer(Client* clientto) {
|
||||
@@ -288,7 +286,7 @@ void ZoneDatabase::RefreshPetitionsFromDB()
|
||||
newpet->SetCheckedOut(true);
|
||||
else
|
||||
newpet->SetCheckedOut(false);
|
||||
petition_list.AddPetition(newpet);
|
||||
PetitionList::Instance()->AddPetition(newpet);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -112,6 +112,12 @@ public:
|
||||
bool FindPetitionByAccountName(const char* acctname);
|
||||
bool DeletePetitionByCharName(const char* charname);
|
||||
|
||||
static PetitionList* Instance()
|
||||
{
|
||||
static PetitionList instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
private:
|
||||
LinkedList<Petition*> list;
|
||||
Mutex PList_Mutex;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "../common/data_verification.h"
|
||||
#include <numbers>
|
||||
#include "../common/types.h"
|
||||
#include <fmt/format.h>
|
||||
|
||||
constexpr float position_eps = 0.0001f;
|
||||
|
||||
|
||||
+58
-10
@@ -1,12 +1,13 @@
|
||||
#include "../common/global_define.h"
|
||||
#include "../common/servertalk.h"
|
||||
#include "../common/strings.h"
|
||||
#include "../common/events/player_event_logs.h"
|
||||
#include "queryserv.h"
|
||||
#include "worldserver.h"
|
||||
|
||||
|
||||
extern WorldServer worldserver;
|
||||
extern QueryServ *QServ;
|
||||
extern QueryServ* QServ;
|
||||
|
||||
QueryServ::QueryServ()
|
||||
{
|
||||
@@ -20,18 +21,29 @@ void QueryServ::SendQuery(std::string Query)
|
||||
{
|
||||
auto pack = new ServerPacket(ServerOP_QSSendQuery, Query.length() + 5);
|
||||
pack->WriteUInt32(Query.length()); /* Pack Query String Size so it can be dynamically broken out at queryserv */
|
||||
pack->WriteString(Query.c_str()); /* Query */
|
||||
pack->WriteString(Query.c_str()); /* Query */
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
void QueryServ::Connect()
|
||||
{
|
||||
m_connection = std::make_unique<EQ::Net::ServertalkClient>(Config->QSHost, Config->QSPort, false, "Zone", Config->SharedKey);
|
||||
m_connection = std::make_unique<EQ::Net::ServertalkClient>(
|
||||
Config->QSHost,
|
||||
Config->QSPort,
|
||||
false,
|
||||
"Zone",
|
||||
Config->SharedKey
|
||||
);
|
||||
m_connection->OnMessage(std::bind(&QueryServ::HandleMessage, this, std::placeholders::_1, std::placeholders::_2));
|
||||
m_connection->OnConnect([this](EQ::Net::ServertalkClient *client) {
|
||||
m_connection->OnConnect([this](EQ::Net::ServertalkClient* client)
|
||||
{
|
||||
m_is_qs_connected = true;
|
||||
LogInfo("Query Server connection established to [{}] [{}]", client->Handle()->RemoteIP(), client->Handle()->RemotePort());
|
||||
LogInfo(
|
||||
"Query Server connection established to [{}] [{}]",
|
||||
client->Handle()->RemoteIP(),
|
||||
client->Handle()->RemotePort()
|
||||
);
|
||||
});
|
||||
|
||||
LogInfo(
|
||||
@@ -41,7 +53,7 @@ void QueryServ::Connect()
|
||||
);
|
||||
}
|
||||
|
||||
bool QueryServ::SendPacket(ServerPacket *pack)
|
||||
bool QueryServ::SendPacket(ServerPacket* pack)
|
||||
{
|
||||
if (m_connection.get() == nullptr) {
|
||||
Connect();
|
||||
@@ -59,14 +71,50 @@ bool QueryServ::SendPacket(ServerPacket *pack)
|
||||
return false;
|
||||
}
|
||||
|
||||
void QueryServ::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
void QueryServ::HandleMessage(uint16 opcode, const EQ::Net::Packet& p)
|
||||
{
|
||||
ServerPacket tpack(opcode, p);
|
||||
auto pack = &tpack;
|
||||
auto pack = &tpack;
|
||||
|
||||
switch (opcode) {
|
||||
default: {
|
||||
LogInfo("Unknown ServerOP Received <red>[{}]", opcode);
|
||||
case ServerOP_SendPlayerEventSettings:
|
||||
{
|
||||
if (pack->size < sizeof(ServerSendPlayerEvent_Struct)) {
|
||||
LogError("ServerOP_SendPlayerEventSettings: packet too small");
|
||||
break;
|
||||
}
|
||||
|
||||
auto* data = reinterpret_cast<const ServerSendPlayerEvent_Struct*>(pack->pBuffer);
|
||||
const uint32_t expected_size = sizeof(ServerSendPlayerEvent_Struct) + data->cereal_size;
|
||||
|
||||
if (pack->size < expected_size) {
|
||||
LogError(
|
||||
"ServerOP_SendPlayerEventSettings: packet size mismatch, expected {}, got {}", expected_size,
|
||||
pack->size
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
std::vector<PlayerEventLogSettingsRepository::PlayerEventLogSettings> settings;
|
||||
|
||||
try {
|
||||
EQ::Util::MemoryStreamReader ms(const_cast<char*>(data->cereal_data), data->cereal_size);
|
||||
cereal::BinaryInputArchive ar(ms);
|
||||
ar(settings);
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
LogError("Failed to deserialize PlayerEventLogSettings: {}", ex.what());
|
||||
break;
|
||||
}
|
||||
|
||||
player_event_logs.LoadPlayerEventSettingsFromQS(settings);
|
||||
LogInfo("Loaded {} PlayerEventLogSettings from queryserv", settings.size());
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
LogInfo("Unknown ServerOP Received [{}]", opcode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -939,7 +939,7 @@ QuestInterface* QuestParserCollection::GetQIByNPCQuest(uint32 npc_id, std::strin
|
||||
|
||||
Strings::FindReplace(npc_name, "`", "-");
|
||||
|
||||
for (auto & dir : path.GetQuestPaths()) {
|
||||
for (auto & dir : PathManager::Instance()->GetQuestPaths()) {
|
||||
const std::string& npc_id_and_name = fmt::format(
|
||||
"{}_{}",
|
||||
npc_name,
|
||||
@@ -1007,7 +1007,7 @@ QuestInterface* QuestParserCollection::GetQIByPlayerQuest(std::string& filename)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (auto & dir : path.GetQuestPaths()) {
|
||||
for (auto & dir : PathManager::Instance()->GetQuestPaths()) {
|
||||
const std::string& global_path = fmt::format(
|
||||
"{}/{}",
|
||||
dir,
|
||||
@@ -1062,7 +1062,7 @@ QuestInterface* QuestParserCollection::GetQIByGlobalNPCQuest(std::string& filena
|
||||
|
||||
std::string file_name;
|
||||
|
||||
for (auto & dir : path.GetQuestPaths()) {
|
||||
for (auto & dir : PathManager::Instance()->GetQuestPaths()) {
|
||||
for (auto* e: _load_precedence) {
|
||||
file_name = fmt::format(
|
||||
"{}/{}/global_npc.{}",
|
||||
@@ -1088,7 +1088,7 @@ QuestInterface* QuestParserCollection::GetQIByGlobalPlayerQuest(std::string& fil
|
||||
}
|
||||
|
||||
std::string file_name;
|
||||
for (auto & dir : path.GetQuestPaths()) {
|
||||
for (auto & dir : PathManager::Instance()->GetQuestPaths()) {
|
||||
for (auto* e: _load_precedence) {
|
||||
file_name = fmt::format(
|
||||
"{}/{}/global_player.{}",
|
||||
@@ -1113,7 +1113,7 @@ QuestInterface* QuestParserCollection::GetQIBySpellQuest(uint32 spell_id, std::s
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (auto & dir : path.GetQuestPaths()) {
|
||||
for (auto & dir : PathManager::Instance()->GetQuestPaths()) {
|
||||
const std::string& global_path = fmt::format(
|
||||
"{}/{}/spells",
|
||||
dir,
|
||||
@@ -1167,7 +1167,7 @@ QuestInterface* QuestParserCollection::GetQIByItemQuest(std::string item_script,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (auto & dir : path.GetQuestPaths()) {
|
||||
for (auto & dir : PathManager::Instance()->GetQuestPaths()) {
|
||||
const std::string& global_path = fmt::format(
|
||||
"{}/{}/items",
|
||||
dir,
|
||||
@@ -1221,7 +1221,7 @@ QuestInterface* QuestParserCollection::GetQIByEncounterQuest(std::string encount
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (auto & dir : path.GetQuestPaths()) {
|
||||
for (auto & dir : PathManager::Instance()->GetQuestPaths()) {
|
||||
const std::string& global_path = fmt::format(
|
||||
"{}/{}/encounters",
|
||||
dir,
|
||||
@@ -1273,7 +1273,7 @@ QuestInterface* QuestParserCollection::GetQIByBotQuest(std::string& filename)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (auto & dir : path.GetQuestPaths()) {
|
||||
for (auto & dir : PathManager::Instance()->GetQuestPaths()) {
|
||||
const std::string& global_path = fmt::format(
|
||||
"{}/{}",
|
||||
dir,
|
||||
@@ -1327,7 +1327,7 @@ QuestInterface* QuestParserCollection::GetQIByGlobalBotQuest(std::string& filena
|
||||
}
|
||||
|
||||
std::string file_name;
|
||||
for (auto & dir : path.GetQuestPaths()) {
|
||||
for (auto & dir : PathManager::Instance()->GetQuestPaths()) {
|
||||
for (auto* e: _load_precedence) {
|
||||
file_name = fmt::format(
|
||||
"{}/{}/global_bot.{}",
|
||||
@@ -1352,7 +1352,7 @@ QuestInterface* QuestParserCollection::GetQIByMercQuest(std::string& filename)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (auto & dir : path.GetQuestPaths()) {
|
||||
for (auto & dir : PathManager::Instance()->GetQuestPaths()) {
|
||||
const std::string& global_path = fmt::format(
|
||||
"{}/{}",
|
||||
dir,
|
||||
@@ -1406,7 +1406,7 @@ QuestInterface* QuestParserCollection::GetQIByGlobalMercQuest(std::string& filen
|
||||
}
|
||||
|
||||
std::string file_name;
|
||||
for (auto & dir : path.GetQuestPaths()) {
|
||||
for (auto & dir : PathManager::Instance()->GetQuestPaths()) {
|
||||
for (auto* e: _load_precedence) {
|
||||
file_name = fmt::format(
|
||||
"{}/{}/global_merc.{}",
|
||||
|
||||
+41
-19
@@ -40,6 +40,7 @@
|
||||
#include "dialogue_window.h"
|
||||
|
||||
#include "../common/repositories/account_repository.h"
|
||||
#include "../common/repositories/completed_tasks_repository.h"
|
||||
#include "../common/repositories/tradeskill_recipe_repository.h"
|
||||
#include "../common/repositories/instance_list_repository.h"
|
||||
#include "../common/repositories/grid_entries_repository.h"
|
||||
@@ -200,7 +201,7 @@ void QuestManager::summonitem(uint32 itemid, int16 charges) {
|
||||
|
||||
void QuestManager::write(const char *file, const char *str) {
|
||||
FILE * pFile;
|
||||
pFile = fopen (fmt::format("{}/{}", path.GetServerPath(), file).c_str(), "a");
|
||||
pFile = fopen (fmt::format("{}/{}", PathManager::Instance()->GetServerPath(), file).c_str(), "a");
|
||||
if(!pFile)
|
||||
return;
|
||||
fprintf(pFile, "%s\n", str);
|
||||
@@ -2868,27 +2869,27 @@ bool QuestManager::createBot(const char *name, const char *lastname, uint8 level
|
||||
|
||||
void QuestManager::taskselector(const std::vector<int>& tasks, bool ignore_cooldown) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner && task_manager)
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner)
|
||||
initiator->TaskQuestSetSelector(owner, tasks, ignore_cooldown);
|
||||
}
|
||||
void QuestManager::enabletask(int taskcount, int *tasks) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && task_manager)
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator)
|
||||
initiator->EnableTask(taskcount, tasks);
|
||||
}
|
||||
|
||||
void QuestManager::disabletask(int taskcount, int *tasks) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && task_manager)
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator)
|
||||
initiator->DisableTask(taskcount, tasks);
|
||||
}
|
||||
|
||||
bool QuestManager::istaskenabled(int taskid) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && task_manager)
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator)
|
||||
return initiator->IsTaskEnabled(taskid);
|
||||
|
||||
return false;
|
||||
@@ -2897,7 +2898,7 @@ bool QuestManager::istaskenabled(int taskid) {
|
||||
void QuestManager::tasksetselector(int tasksetid, bool ignore_cooldown) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
Log(Logs::General, Logs::Tasks, "[UPDATE] TaskSetSelector called for task set %i", tasksetid);
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner && task_manager)
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner)
|
||||
initiator->TaskSetSelector(owner, tasksetid, ignore_cooldown);
|
||||
}
|
||||
|
||||
@@ -2958,6 +2959,27 @@ void QuestManager::failtask(int taskid) {
|
||||
initiator->FailTask(taskid);
|
||||
}
|
||||
|
||||
bool QuestManager::completetask(int task_id) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if (!RuleB(TaskSystem, EnableTaskSystem) || !initiator) {
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
return initiator->CompleteTask(task_id);
|
||||
}
|
||||
|
||||
bool QuestManager::uncompletetask(int task_id) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if (!RuleB(TaskSystem, EnableTaskSystem) || !initiator) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return initiator->UncompleteTask(task_id);
|
||||
}
|
||||
|
||||
int QuestManager::tasktimeleft(int taskid) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
@@ -2979,8 +3001,8 @@ int QuestManager::enabledtaskcount(int taskset) {
|
||||
int QuestManager::firsttaskinset(int taskset) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && task_manager)
|
||||
return task_manager->FirstTaskInSet(taskset);
|
||||
if(RuleB(TaskSystem, EnableTaskSystem))
|
||||
return TaskManager::Instance()->FirstTaskInSet(taskset);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@@ -2988,8 +3010,8 @@ int QuestManager::firsttaskinset(int taskset) {
|
||||
int QuestManager::lasttaskinset(int taskset) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && task_manager)
|
||||
return task_manager->LastTaskInSet(taskset);
|
||||
if(RuleB(TaskSystem, EnableTaskSystem))
|
||||
return TaskManager::Instance()->LastTaskInSet(taskset);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@@ -2997,8 +3019,8 @@ int QuestManager::lasttaskinset(int taskset) {
|
||||
int QuestManager::nexttaskinset(int taskset, int taskid) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && task_manager)
|
||||
return task_manager->NextTaskInSet(taskset, taskid);
|
||||
if(RuleB(TaskSystem, EnableTaskSystem))
|
||||
return TaskManager::Instance()->NextTaskInSet(taskset, taskid);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@@ -3063,8 +3085,8 @@ int QuestManager::completedtasksinset(int taskset) {
|
||||
bool QuestManager::istaskappropriate(int task) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && task_manager)
|
||||
return task_manager->ValidateLevel(task, initiator->GetLevel());
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator)
|
||||
return TaskManager::Instance()->ValidateLevel(task, initiator->GetLevel());
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -3073,7 +3095,7 @@ std::string QuestManager::gettaskname(uint32 task_id) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if (RuleB(TaskSystem, EnableTaskSystem)) {
|
||||
return task_manager->GetTaskName(task_id);
|
||||
return TaskManager::Instance()->GetTaskName(task_id);
|
||||
}
|
||||
|
||||
return std::string();
|
||||
@@ -3082,8 +3104,8 @@ std::string QuestManager::gettaskname(uint32 task_id) {
|
||||
int QuestManager::GetCurrentDzTaskID() {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if (RuleB(TaskSystem, EnableTaskSystem) && zone && task_manager) {
|
||||
return task_manager->GetCurrentDzTaskID();
|
||||
if (RuleB(TaskSystem, EnableTaskSystem) && zone) {
|
||||
return TaskManager::Instance()->GetCurrentDzTaskID();
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -3092,8 +3114,8 @@ int QuestManager::GetCurrentDzTaskID() {
|
||||
void QuestManager::EndCurrentDzTask(bool send_fail) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if (RuleB(TaskSystem, EnableTaskSystem) && zone && task_manager) {
|
||||
task_manager->EndCurrentDzTask(send_fail);
|
||||
if (RuleB(TaskSystem, EnableTaskSystem) && zone) {
|
||||
TaskManager::Instance()->EndCurrentDzTask(send_fail);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -224,6 +224,8 @@ public:
|
||||
void resettaskactivity(int task, int activity);
|
||||
void assigntask(int taskid, bool enforce_level_requirement = false);
|
||||
void failtask(int taskid);
|
||||
bool completetask(int task_id);
|
||||
bool uncompletetask(int task_id);
|
||||
int tasktimeleft(int taskid);
|
||||
bool istaskcompleted(int task_id);
|
||||
bool aretaskscompleted(const std::vector<int>& task_ids);
|
||||
|
||||
@@ -157,7 +157,7 @@ void SharedTaskZoneMessaging::HandleWorldMessage(ServerPacket *pack)
|
||||
|
||||
for (auto &client: entity_list.GetClientList()) {
|
||||
Client *c = client.second;
|
||||
task_manager->SyncClientSharedTaskState(c, c->GetTaskState());
|
||||
TaskManager::Instance()->SyncClientSharedTaskState(c, c->GetTaskState());
|
||||
c->RemoveClientTaskState();
|
||||
c->LoadClientTaskState();
|
||||
}
|
||||
|
||||
+51
-55
@@ -66,7 +66,7 @@ void ClientTaskState::SendTaskHistory(Client *client, int task_index)
|
||||
return;
|
||||
}
|
||||
|
||||
const auto task_data = task_manager->GetTaskData(task_id);
|
||||
const auto task_data = TaskManager::Instance()->GetTaskData(task_id);
|
||||
if (!task_data) {
|
||||
return;
|
||||
}
|
||||
@@ -252,16 +252,16 @@ int ClientTaskState::EnabledTaskCount(int task_set_id)
|
||||
if ((task_set_id <= 0) || (task_set_id >= MAXTASKSETS)) { return -1; }
|
||||
|
||||
while ((enabled_task_index < m_enabled_tasks.size()) &&
|
||||
(task_set_index < task_manager->m_task_sets[task_set_id].size())) {
|
||||
(task_set_index < TaskManager::Instance()->m_task_sets[task_set_id].size())) {
|
||||
|
||||
if (m_enabled_tasks[enabled_task_index] == task_manager->m_task_sets[task_set_id][task_set_index]) {
|
||||
if (m_enabled_tasks[enabled_task_index] == TaskManager::Instance()->m_task_sets[task_set_id][task_set_index]) {
|
||||
enabled_task_count++;
|
||||
enabled_task_index++;
|
||||
task_set_index++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_enabled_tasks[enabled_task_index] < task_manager->m_task_sets[task_set_id][task_set_index]) {
|
||||
if (m_enabled_tasks[enabled_task_index] < TaskManager::Instance()->m_task_sets[task_set_id][task_set_index]) {
|
||||
enabled_task_index++;
|
||||
}
|
||||
else {
|
||||
@@ -281,7 +281,7 @@ int ClientTaskState::ActiveTasksInSet(int task_set_id)
|
||||
|
||||
int active_task_in_set_count = 0;
|
||||
|
||||
for (int task_id : task_manager->m_task_sets[task_set_id]) {
|
||||
for (int task_id : TaskManager::Instance()->m_task_sets[task_set_id]) {
|
||||
if (IsTaskActive(task_id)) {
|
||||
active_task_in_set_count++;
|
||||
}
|
||||
@@ -298,7 +298,7 @@ int ClientTaskState::CompletedTasksInSet(int task_set_id)
|
||||
|
||||
int completed_tasks_count = 0;
|
||||
|
||||
for (int i : task_manager->m_task_sets[task_set_id]) {
|
||||
for (int i : TaskManager::Instance()->m_task_sets[task_set_id]) {
|
||||
if (IsTaskCompleted(i)) {
|
||||
completed_tasks_count++;
|
||||
}
|
||||
@@ -362,7 +362,7 @@ bool ClientTaskState::UnlockActivities(Client* client, ClientTaskInformation& ta
|
||||
task_info.updated
|
||||
);
|
||||
|
||||
const auto task = task_manager->GetTaskData(task_info.task_id);
|
||||
const auto task = TaskManager::Instance()->GetTaskData(task_info.task_id);
|
||||
if (!task)
|
||||
{
|
||||
return true;
|
||||
@@ -453,7 +453,7 @@ const TaskInformation* ClientTaskState::GetTaskData(const ClientTaskInformation&
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return task_manager->GetTaskData(client_task.task_id);
|
||||
return TaskManager::Instance()->GetTaskData(client_task.task_id);
|
||||
}
|
||||
|
||||
bool ClientTaskState::CanUpdate(Client* client, const TaskUpdateFilter& filter, int task_id,
|
||||
@@ -521,11 +521,6 @@ bool ClientTaskState::CanUpdate(Client* client, const TaskUpdateFilter& filter,
|
||||
|
||||
int ClientTaskState::UpdateTasks(Client* client, const TaskUpdateFilter& filter, int count)
|
||||
{
|
||||
if (!task_manager)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int max_updated = 0;
|
||||
|
||||
for (const auto& client_task : m_active_tasks)
|
||||
@@ -593,11 +588,6 @@ int ClientTaskState::UpdateTasks(Client* client, const TaskUpdateFilter& filter,
|
||||
|
||||
std::pair<int, int> ClientTaskState::FindTask(Client* client, const TaskUpdateFilter& filter) const
|
||||
{
|
||||
if (!task_manager)
|
||||
{
|
||||
return std::make_pair(0, 0);
|
||||
}
|
||||
|
||||
for (const auto& client_task : m_active_tasks)
|
||||
{
|
||||
const auto task = GetTaskData(client_task);
|
||||
@@ -901,7 +891,7 @@ int ClientTaskState::IncrementDoneCount(
|
||||
// and by the 'Task Stage Completed' message
|
||||
client->SendTaskActivityComplete(info->task_id, activity_id, task_index, task_data->type);
|
||||
// Send the updated task/activity_information list to the client
|
||||
task_manager->SendSingleActiveTaskToClient(client, *info, task_complete, false);
|
||||
TaskManager::Instance()->SendSingleActiveTaskToClient(client, *info, task_complete, false);
|
||||
|
||||
if (!ignore_quest_update) {
|
||||
if (parse->PlayerHasQuestSub(EVENT_TASK_STAGE_COMPLETE)) {
|
||||
@@ -929,7 +919,7 @@ int ClientTaskState::IncrementDoneCount(
|
||||
if (player_event_logs.IsEventEnabled(PlayerEvent::TASK_COMPLETE)) {
|
||||
auto e = PlayerEvent::TaskCompleteEvent{
|
||||
.task_id = static_cast<uint32>(info->task_id),
|
||||
.task_name = task_manager->GetTaskName(static_cast<uint32>(info->task_id)),
|
||||
.task_name = TaskManager::Instance()->GetTaskName(static_cast<uint32>(info->task_id)),
|
||||
.activity_id = static_cast<uint32>(info->activity[activity_id].activity_id),
|
||||
.done_count = static_cast<uint32>(info->activity[activity_id].done_count)
|
||||
};
|
||||
@@ -948,7 +938,7 @@ int ClientTaskState::IncrementDoneCount(
|
||||
|
||||
// shared tasks linger at the completion step and do not get removed from the task window unlike quests/task
|
||||
if (task_data->type != TaskType::Shared) {
|
||||
task_manager->SendCompletedTasksToClient(client, this);
|
||||
TaskManager::Instance()->SendCompletedTasksToClient(client, this);
|
||||
|
||||
client->CancelTask(task_index, task_data->type);
|
||||
}
|
||||
@@ -958,7 +948,7 @@ int ClientTaskState::IncrementDoneCount(
|
||||
}
|
||||
else {
|
||||
// Send an updated packet for this single activity_information
|
||||
task_manager->SendTaskActivityLong(
|
||||
TaskManager::Instance()->SendTaskActivityLong(
|
||||
client,
|
||||
info->task_id,
|
||||
activity_id,
|
||||
@@ -968,7 +958,7 @@ int ClientTaskState::IncrementDoneCount(
|
||||
if (player_event_logs.IsEventEnabled(PlayerEvent::TASK_UPDATE)) {
|
||||
auto e = PlayerEvent::TaskUpdateEvent{
|
||||
.task_id = static_cast<uint32>(info->task_id),
|
||||
.task_name = task_manager->GetTaskName(static_cast<uint32>(info->task_id)),
|
||||
.task_name = TaskManager::Instance()->GetTaskName(static_cast<uint32>(info->task_id)),
|
||||
.activity_id = static_cast<uint32>(info->activity[activity_id].activity_id),
|
||||
.done_count = static_cast<uint32>(info->activity[activity_id].done_count)
|
||||
};
|
||||
@@ -976,7 +966,7 @@ int ClientTaskState::IncrementDoneCount(
|
||||
}
|
||||
}
|
||||
|
||||
task_manager->SaveClientState(client, this);
|
||||
TaskManager::Instance()->SaveClientState(client, this);
|
||||
|
||||
return count;
|
||||
}
|
||||
@@ -1149,7 +1139,7 @@ void ClientTaskState::FailTask(Client *client, int task_id)
|
||||
|
||||
// type: Shared Task (failed via world for all members)
|
||||
if (m_active_shared_task.task_id == task_id) {
|
||||
task_manager->EndSharedTask(*client, task_id, true);
|
||||
TaskManager::Instance()->EndSharedTask(*client, task_id, true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1211,7 +1201,7 @@ bool ClientTaskState::IsTaskActivityActive(int task_id, int activity_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto task_data = task_manager->GetTaskData(info->task_id);
|
||||
const auto task_data = TaskManager::Instance()->GetTaskData(info->task_id);
|
||||
if (!task_data) {
|
||||
return false;
|
||||
}
|
||||
@@ -1282,7 +1272,7 @@ void ClientTaskState::UpdateTaskActivity(
|
||||
return;
|
||||
}
|
||||
|
||||
const auto task_data = task_manager->GetTaskData(info->task_id);
|
||||
const auto task_data = TaskManager::Instance()->GetTaskData(info->task_id);
|
||||
if (!task_data) {
|
||||
return;
|
||||
}
|
||||
@@ -1352,7 +1342,7 @@ void ClientTaskState::ResetTaskActivity(Client *client, int task_id, int activit
|
||||
return;
|
||||
}
|
||||
|
||||
const auto task_data = task_manager->GetTaskData(info->task_id);
|
||||
const auto task_data = TaskManager::Instance()->GetTaskData(info->task_id);
|
||||
if (!task_data) {
|
||||
return;
|
||||
}
|
||||
@@ -1386,14 +1376,14 @@ void ClientTaskState::ResetTaskActivity(Client *client, int task_id, int activit
|
||||
|
||||
bool ClientTaskState::CompleteTask(Client *c, uint32 task_id)
|
||||
{
|
||||
const auto task_data = task_manager->GetTaskData(task_id);
|
||||
const auto task_data = TaskManager::Instance()->GetTaskData(task_id);
|
||||
if (!task_data) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (
|
||||
int activity_id = 0;
|
||||
activity_id < task_manager->GetActivityCount(task_id);
|
||||
activity_id < TaskManager::Instance()->GetActivityCount(task_id);
|
||||
activity_id++
|
||||
) {
|
||||
c->UpdateTaskActivity(
|
||||
@@ -1406,9 +1396,19 @@ bool ClientTaskState::CompleteTask(Client *c, uint32 task_id)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ClientTaskState::UncompleteTask(int task_id)
|
||||
{
|
||||
return std::erase_if(
|
||||
m_completed_tasks,
|
||||
[&](const CompletedTaskInformation& task) {
|
||||
return task.task_id == task_id;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void ClientTaskState::ShowClientTaskInfoMessage(ClientTaskInformation *task, Client *c)
|
||||
{
|
||||
const auto task_data = task_manager->GetTaskData(task->task_id);
|
||||
const auto task_data = TaskManager::Instance()->GetTaskData(task->task_id);
|
||||
|
||||
c->Message(Chat::White, "------------------------------------------------");
|
||||
c->Message(
|
||||
@@ -1430,7 +1430,7 @@ void ClientTaskState::ShowClientTaskInfoMessage(ClientTaskInformation *task, Cli
|
||||
).c_str()
|
||||
);
|
||||
|
||||
for (int activity_id = 0; activity_id < task_manager->GetActivityCount(task->task_id); activity_id++) {
|
||||
for (int activity_id = 0; activity_id < TaskManager::Instance()->GetActivityCount(task->task_id); activity_id++) {
|
||||
std::vector<std::string> update_increments = { "1", "5", "10", "20", "50" };
|
||||
std::vector<std::string> update_saylinks;
|
||||
|
||||
@@ -1501,7 +1501,7 @@ int ClientTaskState::TaskTimeLeft(int task_id)
|
||||
if (m_active_task.task_id == task_id) {
|
||||
int time_now = time(nullptr);
|
||||
|
||||
const auto task_data = task_manager->GetTaskData(task_id);
|
||||
const auto task_data = TaskManager::Instance()->GetTaskData(task_id);
|
||||
if (!task_data) {
|
||||
return -1;
|
||||
}
|
||||
@@ -1519,7 +1519,7 @@ int ClientTaskState::TaskTimeLeft(int task_id)
|
||||
if (m_active_shared_task.task_id == task_id) {
|
||||
int time_now = time(nullptr);
|
||||
|
||||
const auto task_data = task_manager->GetTaskData(task_id);
|
||||
const auto task_data = TaskManager::Instance()->GetTaskData(task_id);
|
||||
if (!task_data) {
|
||||
return -1;
|
||||
}
|
||||
@@ -1544,7 +1544,7 @@ int ClientTaskState::TaskTimeLeft(int task_id)
|
||||
|
||||
int time_now = time(nullptr);
|
||||
|
||||
const auto task_data = task_manager->GetTaskData(active_quest.task_id);
|
||||
const auto task_data = TaskManager::Instance()->GetTaskData(active_quest.task_id);
|
||||
if (!task_data) {
|
||||
return -1;
|
||||
}
|
||||
@@ -1616,7 +1616,7 @@ bool ClientTaskState::TaskOutOfTime(TaskType task_type, int index)
|
||||
}
|
||||
|
||||
int time_now = time(nullptr);
|
||||
const auto task_data = task_manager->GetTaskData(info->task_id);
|
||||
const auto task_data = TaskManager::Instance()->GetTaskData(info->task_id);
|
||||
if (!task_data) {
|
||||
return false;
|
||||
}
|
||||
@@ -1936,7 +1936,7 @@ void ClientTaskState::RemoveTask(Client *client, int sequence_number, TaskType t
|
||||
|
||||
void ClientTaskState::RemoveTaskByTaskID(Client *client, uint32 task_id)
|
||||
{
|
||||
switch (task_manager->GetTaskType(task_id)) {
|
||||
switch (TaskManager::Instance()->GetTaskType(task_id)) {
|
||||
case TaskType::Task: {
|
||||
if (m_active_task.task_id == task_id) {
|
||||
LogTasks("RemoveTaskByTaskID found Task [{}]", task_id);
|
||||
@@ -1973,12 +1973,12 @@ void ClientTaskState::AcceptNewTask(
|
||||
bool enforce_level_requirement
|
||||
)
|
||||
{
|
||||
if (!task_manager || task_id < 0) {
|
||||
if (task_id < 0) {
|
||||
client->Message(Chat::Red, "Task system not functioning, or task_id %i out of range.", task_id);
|
||||
return;
|
||||
}
|
||||
|
||||
const auto task = task_manager->GetTaskData(task_id);
|
||||
const auto task = TaskManager::Instance()->GetTaskData(task_id);
|
||||
if (!task) {
|
||||
client->Message(Chat::Red, "Invalid task_id %i", task_id);
|
||||
return;
|
||||
@@ -2048,12 +2048,12 @@ void ClientTaskState::AcceptNewTask(
|
||||
}
|
||||
}
|
||||
|
||||
if (enforce_level_requirement && !task_manager->ValidateLevel(task_id, client->GetLevel())) {
|
||||
if (enforce_level_requirement && !TaskManager::Instance()->ValidateLevel(task_id, client->GetLevel())) {
|
||||
client->MessageString(Chat::Yellow, TASK_NOT_RIGHT_LEVEL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!task_manager->IsTaskRepeatable(task_id) && IsTaskCompleted(task_id)) {
|
||||
if (!TaskManager::Instance()->IsTaskRepeatable(task_id) && IsTaskCompleted(task_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2184,11 +2184,11 @@ void ClientTaskState::AcceptNewTask(
|
||||
}
|
||||
}
|
||||
|
||||
task_manager->SendSingleActiveTaskToClient(client, *active_slot, false, true);
|
||||
TaskManager::Instance()->SendSingleActiveTaskToClient(client, *active_slot, false, true);
|
||||
client->StartTaskRequestCooldownTimer();
|
||||
client->MessageString(Chat::DefaultText, YOU_ASSIGNED_TASK, task->title.c_str());
|
||||
|
||||
task_manager->SaveClientState(client, this);
|
||||
TaskManager::Instance()->SaveClientState(client, this);
|
||||
|
||||
NPC *npc = entity_list.GetNPCByID(npc_entity_id);
|
||||
if (npc) {
|
||||
@@ -2197,7 +2197,7 @@ void ClientTaskState::AcceptNewTask(
|
||||
.npc_id = npc->GetNPCTypeID(),
|
||||
.npc_name = npc->GetCleanName(),
|
||||
.task_id = static_cast<uint32>(task_id),
|
||||
.task_name = task_manager->GetTaskName(static_cast<uint32>(task_id)),
|
||||
.task_name = TaskManager::Instance()->GetTaskName(static_cast<uint32>(task_id)),
|
||||
};
|
||||
RecordPlayerEventLogWithClient(client, PlayerEvent::TASK_ACCEPT, e);
|
||||
}
|
||||
@@ -2211,7 +2211,7 @@ void ClientTaskState::AcceptNewTask(
|
||||
.npc_id = 0,
|
||||
.npc_name = "No NPC",
|
||||
.task_id = static_cast<uint32>(task_id),
|
||||
.task_name = task_manager->GetTaskName(static_cast<uint32>(task_id)),
|
||||
.task_name = TaskManager::Instance()->GetTaskName(static_cast<uint32>(task_id)),
|
||||
};
|
||||
RecordPlayerEventLogWithClient(client, PlayerEvent::TASK_ACCEPT, e);
|
||||
}
|
||||
@@ -2247,7 +2247,7 @@ void ClientTaskState::SharedTaskIncrementDoneCount(
|
||||
bool ignore_quest_update
|
||||
)
|
||||
{
|
||||
const auto t = task_manager->GetTaskData(task_id);
|
||||
const auto t = TaskManager::Instance()->GetTaskData(task_id);
|
||||
|
||||
auto info = GetClientTaskInfo(t->type, TASKSLOTSHAREDTASK);
|
||||
if (info == nullptr) {
|
||||
@@ -2286,14 +2286,14 @@ bool ClientTaskState::HasActiveSharedTask()
|
||||
|
||||
void ClientTaskState::CreateTaskDynamicZone(Client* client, int task_id, DynamicZone& dz_request)
|
||||
{
|
||||
const auto task = task_manager->GetTaskData(task_id);
|
||||
const auto task = TaskManager::Instance()->GetTaskData(task_id);
|
||||
if (!task)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// dz should be named the version-based zone name (used in choose zone window and dz window on live)
|
||||
auto zone_info = zone_store.GetZoneWithFallback(dz_request.GetZoneID(), dz_request.GetZoneVersion());
|
||||
auto zone_info = ZoneStore::Instance()->GetZoneWithFallback(dz_request.GetZoneID(), dz_request.GetZoneVersion());
|
||||
dz_request.SetName(zone_info && !zone_info->long_name.empty() ? zone_info->long_name : task->title);
|
||||
dz_request.SetMinPlayers(task->min_players);
|
||||
dz_request.SetMaxPlayers(task->max_players);
|
||||
@@ -2349,7 +2349,7 @@ void ClientTaskState::ListTaskTimers(Client* client)
|
||||
|
||||
for (const auto& task_timer : character_task_timers)
|
||||
{
|
||||
const auto task = task_manager->GetTaskData(task_timer.task_id);
|
||||
const auto task = TaskManager::Instance()->GetTaskData(task_timer.task_id);
|
||||
if (task)
|
||||
{
|
||||
auto timer_type = static_cast<TaskTimerType>(task_timer.timer_type);
|
||||
@@ -2455,10 +2455,6 @@ void ClientTaskState::SyncSharedTaskZoneClientDoneCountState(
|
||||
|
||||
bool ClientTaskState::HasActiveTasks()
|
||||
{
|
||||
if (!task_manager) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_active_task.task_id != TASKSLOTEMPTY) {
|
||||
return true;
|
||||
}
|
||||
@@ -2495,9 +2491,9 @@ void ClientTaskState::LockSharedTask(Client* client, bool lock)
|
||||
|
||||
void ClientTaskState::EndSharedTask(Client* client, bool send_fail)
|
||||
{
|
||||
if (task_manager && m_active_shared_task.task_id != TASKSLOTEMPTY)
|
||||
if (m_active_shared_task.task_id != TASKSLOTEMPTY)
|
||||
{
|
||||
task_manager->EndSharedTask(*client, m_active_shared_task.task_id, send_fail);
|
||||
TaskManager::Instance()->EndSharedTask(*client, m_active_shared_task.task_id, send_fail);
|
||||
}
|
||||
}
|
||||
bool ClientTaskState::CanAcceptNewTask(Client* client, int task_id, int npc_entity_id) const
|
||||
|
||||
@@ -86,6 +86,7 @@ public:
|
||||
bool HasExploreTask(Client* client) const;
|
||||
void EndSharedTask(Client* client, bool send_fail);
|
||||
bool CompleteTask(Client *c, uint32 task_id);
|
||||
bool UncompleteTask(int task_id);
|
||||
|
||||
inline bool HasFreeTaskSlot() { return m_active_task.task_id == TASKSLOTEMPTY; }
|
||||
|
||||
|
||||
@@ -70,6 +70,12 @@ public:
|
||||
return it != m_task_data.end() ? &it->second : nullptr;
|
||||
}
|
||||
|
||||
static TaskManager* Instance()
|
||||
{
|
||||
static TaskManager instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<int> m_task_sets[MAXTASKSETS];
|
||||
std::unordered_map<uint32_t, TaskInformation> m_task_data;
|
||||
|
||||
+4
-4
@@ -14,17 +14,17 @@ extern QueryServ *QServ;
|
||||
|
||||
void Client::LoadClientTaskState()
|
||||
{
|
||||
if (RuleB(TaskSystem, EnableTaskSystem) && task_manager) {
|
||||
if (RuleB(TaskSystem, EnableTaskSystem)) {
|
||||
LoadClientSharedCompletedTasks();
|
||||
|
||||
safe_delete(task_state);
|
||||
task_state = new ClientTaskState();
|
||||
if (!task_manager->LoadClientState(this, task_state)) {
|
||||
if (!TaskManager::Instance()->LoadClientState(this, task_state)) {
|
||||
safe_delete(task_state);
|
||||
}
|
||||
else {
|
||||
task_manager->SendActiveTasksToClient(this);
|
||||
task_manager->SendCompletedTasksToClient(this, task_state);
|
||||
TaskManager::Instance()->SendActiveTasksToClient(this);
|
||||
TaskManager::Instance()->SendCompletedTasksToClient(this, task_state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
WaterMap* WaterMap::LoadWaterMapfile(std::string zone_name) {
|
||||
std::transform(zone_name.begin(), zone_name.end(), zone_name.begin(), ::tolower);
|
||||
|
||||
std::string file_path = fmt::format("{}/water/{}.wtr", path.GetMapsPath(), zone_name);
|
||||
std::string file_path = fmt::format("{}/water/{}.wtr", PathManager::Instance()->GetMapsPath(), zone_name);
|
||||
LogDebug("Attempting to load water map with path [{}]", file_path.c_str());
|
||||
FILE *f = fopen(file_path.c_str(), "rb");
|
||||
if(f) {
|
||||
|
||||
+10
-11
@@ -68,7 +68,6 @@ extern Zone *zone;
|
||||
extern volatile bool is_zone_loaded;
|
||||
extern void Shutdown();
|
||||
extern WorldServer worldserver;
|
||||
extern PetitionList petition_list;
|
||||
extern uint32 numclients;
|
||||
extern volatile bool RunLoops;
|
||||
extern QuestParserCollection *parse;
|
||||
@@ -911,8 +910,8 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
std::cout << "Got Server Requested Petition List Refresh" << std::endl;
|
||||
ServerPetitionUpdate_Struct* sus = (ServerPetitionUpdate_Struct*)pack->pBuffer;
|
||||
// this was typoed to = instead of ==, not that it acts any different now though..
|
||||
if (sus->status == 0) petition_list.ReadDatabase();
|
||||
else if (sus->status == 1) petition_list.ReadDatabase(); // Until I fix this to be better....
|
||||
if (sus->status == 0) PetitionList::Instance()->ReadDatabase();
|
||||
else if (sus->status == 1) PetitionList::Instance()->ReadDatabase(); // Until I fix this to be better....
|
||||
break;
|
||||
}
|
||||
case ServerOP_RezzPlayer: {
|
||||
@@ -3140,7 +3139,6 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
case ServerOP_WWMarquee:
|
||||
{
|
||||
auto s = (WWMarquee_Struct*) pack->pBuffer;
|
||||
|
||||
for (const auto& c : entity_list.GetClientList()) {
|
||||
if (
|
||||
c.second->Admin() >= s->min_status &&
|
||||
@@ -4592,7 +4590,10 @@ void WorldServer::ProcessReload(const ServerReload::Request& request)
|
||||
|
||||
case ServerReload::Type::Logs:
|
||||
LogSys.LoadLogDatabaseSettings();
|
||||
player_event_logs.ReloadSettings();
|
||||
// if QS process is enabled, we get settings from QS
|
||||
if (!RuleB(Logging, PlayerEventsQSProcess)) {
|
||||
player_event_logs.ReloadSettings();
|
||||
}
|
||||
break;
|
||||
|
||||
case ServerReload::Type::Loot:
|
||||
@@ -4627,7 +4628,7 @@ void WorldServer::ProcessReload(const ServerReload::Request& request)
|
||||
break;
|
||||
|
||||
case ServerReload::Type::SkillCaps:
|
||||
skill_caps.ReloadSkillCaps();
|
||||
SkillCaps::Instance()->ReloadSkillCaps();
|
||||
break;
|
||||
|
||||
case ServerReload::Type::DataBucketsCache:
|
||||
@@ -4644,11 +4645,9 @@ void WorldServer::ProcessReload(const ServerReload::Request& request)
|
||||
case ServerReload::Type::Tasks:
|
||||
if (RuleB(Tasks, EnableTaskSystem)) {
|
||||
entity_list.SaveAllClientsTaskState();
|
||||
safe_delete(task_manager);
|
||||
task_manager = new TaskManager;
|
||||
task_manager->LoadTasks();
|
||||
TaskManager::Instance()->LoadTasks();
|
||||
entity_list.ReloadAllClientsTaskState();
|
||||
task_manager->LoadTaskSets();
|
||||
TaskManager::Instance()->LoadTaskSets();
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -4700,7 +4699,7 @@ void WorldServer::ProcessReload(const ServerReload::Request& request)
|
||||
break;
|
||||
|
||||
case ServerReload::Type::ZoneData:
|
||||
zone_store.LoadZones(content_db);
|
||||
ZoneStore::Instance()->LoadZones(content_db);
|
||||
zone->LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion());
|
||||
break;
|
||||
|
||||
|
||||
+6
-9
@@ -81,15 +81,12 @@
|
||||
#endif
|
||||
|
||||
extern bool staticzone;
|
||||
extern PetitionList petition_list;
|
||||
extern QuestParserCollection* parse;
|
||||
extern uint32 numclients;
|
||||
extern WorldServer worldserver;
|
||||
extern Zone* zone;
|
||||
extern NpcScaleManager* npc_scale_manager;
|
||||
|
||||
Mutex MZoneShutdown;
|
||||
|
||||
volatile bool is_zone_loaded = false;
|
||||
Zone* zone = 0;
|
||||
|
||||
@@ -926,7 +923,7 @@ void Zone::Shutdown(bool quiet)
|
||||
GetInstanceVersion(),
|
||||
GetInstanceID()
|
||||
);
|
||||
petition_list.ClearPetitions();
|
||||
PetitionList::Instance()->ClearPetitions();
|
||||
SetZoneHasCurrentTime(false);
|
||||
if (!quiet) {
|
||||
LogInfo(
|
||||
@@ -1236,8 +1233,8 @@ bool Zone::Init(bool is_static) {
|
||||
LoadMercenarySpells();
|
||||
}
|
||||
|
||||
petition_list.ClearPetitions();
|
||||
petition_list.ReadDatabase();
|
||||
PetitionList::Instance()->ClearPetitions();
|
||||
PetitionList::Instance()->ReadDatabase();
|
||||
|
||||
guild_mgr.LoadGuilds();
|
||||
|
||||
@@ -1302,7 +1299,7 @@ void Zone::ReloadStaticData() {
|
||||
|
||||
bool Zone::LoadZoneCFG(const char* filename, uint16 instance_version)
|
||||
{
|
||||
auto z = zone_store.GetZoneWithFallback(ZoneID(filename), instance_version);
|
||||
auto z = ZoneStore::Instance()->GetZoneWithFallback(ZoneID(filename), instance_version);
|
||||
|
||||
if (!z) {
|
||||
LogError("Failed to load zone data for [{}] instance_version [{}]", filename, instance_version);
|
||||
@@ -2253,7 +2250,7 @@ void Zone::LoadZoneBlockedSpells()
|
||||
if (!content_db.LoadBlockedSpells(zone_total_blocked_spells, blocked_spells, GetZoneID())) {
|
||||
LogError(
|
||||
"Failed to load blocked spells for {} ({}).",
|
||||
zone_store.GetZoneName(GetZoneID(), true),
|
||||
ZoneStore::Instance()->GetZoneName(GetZoneID(), true),
|
||||
GetZoneID()
|
||||
);
|
||||
ClearBlockedSpells();
|
||||
@@ -2263,7 +2260,7 @@ void Zone::LoadZoneBlockedSpells()
|
||||
LogInfo(
|
||||
"Loaded [{}] blocked spells(s) for {} ({}).",
|
||||
Strings::Commify(zone_total_blocked_spells),
|
||||
zone_store.GetZoneName(GetZoneID(), true),
|
||||
ZoneStore::Instance()->GetZoneName(GetZoneID(), true),
|
||||
GetZoneID()
|
||||
);
|
||||
}
|
||||
|
||||
+2
-2
@@ -2639,7 +2639,7 @@ int64 ZoneDatabase::GetBlockedSpellsCount(uint32 zone_id)
|
||||
|
||||
bool ZoneDatabase::LoadBlockedSpells(int64 blocked_spells_count, ZoneSpellsBlocked* into, uint32 zone_id)
|
||||
{
|
||||
LogInfo("Loading Blocked Spells from database for {} ({}).", zone_store.GetZoneName(zone_id, true), zone_id);
|
||||
LogInfo("Loading Blocked Spells from database for {} ({}).", ZoneStore::Instance()->GetZoneName(zone_id, true), zone_id);
|
||||
|
||||
const auto& l = BlockedSpellsRepository::GetWhere(
|
||||
*this,
|
||||
@@ -2661,7 +2661,7 @@ bool ZoneDatabase::LoadBlockedSpells(int64 blocked_spells_count, ZoneSpellsBlock
|
||||
LogError(
|
||||
"Blocked spells count of {} exceeded for {} ({}).",
|
||||
blocked_spells_count,
|
||||
zone_store.GetZoneName(zone_id, true),
|
||||
ZoneStore::Instance()->GetZoneName(zone_id, true),
|
||||
zone_id
|
||||
);
|
||||
break;
|
||||
|
||||
+1
-1
@@ -352,7 +352,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
|
||||
if (content_service.GetCurrentExpansion() >= Expansion::Classic && !GetGM()) {
|
||||
bool meets_zone_expansion_check = false;
|
||||
|
||||
auto z = zone_store.GetZoneWithFallback(ZoneID(target_zone_name), 0);
|
||||
auto z = ZoneStore::Instance()->GetZoneWithFallback(ZoneID(target_zone_name), 0);
|
||||
if (z->expansion <= content_service.GetCurrentExpansion() || z->bypass_expansion_check) {
|
||||
meets_zone_expansion_check = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user