mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
* Implement spell AI pulling, fix throw stone * more pull tweaks * holding check at start of ai process * fully implement ^pull logic to always return, can still be overidden by ^attack * Rewrite ^pull logic and handling. **MORE** Add ^setassistee command to set who your bots will assist. Bots will always assist you first before anyone else. If the rule Bots, AllowCrossGroupRaidAssist is enabled bots will assist the group or raid main assists. Rewrites logic in handling of pull and returning to ensure bots make it back to their location. * Move HateLine to a better ID * cleanup ST_Self logic in CastChecks * Removed unused BotSpellTypeRequiresLoS * Move fizzle message to define * add timer checks to Idle/Engaged/Pursue CastCheck to early terminate * Add back !IsBotNonSpellFighter() check to the different CastCheck * Correct IsValidSpellRange * Implement AAs and harmtouch/layonhands to ^cast --- fix IsValidSpellRange * Add PetDamageShields and PetResistBuffs to IsPetBotSpellType() * Add priorities to HateLine inserts for db update * Remove SpellTypeRequiresCastChecks * Add bot check to DetermineSpellTargets for IsIllusionSpell * merge with previous * Correct bot checks for ST_GroupClientAndPet * Remove misc target_type checks * Add lull/aelull to ^cast * Add more checks for CommandedSubTypes::AETarget * remove unneeded checks on IsValidSpellTypeBySpellID * add to aelull * rewrite GetCorrectSpellType * Add IsBlockedBuff to CastChecks * Add spellid option to ^cast to allow casting of a specific spell by ID * ^cast adjustments for spellid casts * Add missing alert round for ranged attacks * More castcheck improvements * CanUseBotSpell for ^cast * remove ht/loh from attack ai * remove SetCombatRoundForAlerts that triggered every engagement * Add RangedAttackImmunity checks before trying to ranged attack * move bot backstab to mob * fix MinStatusToBypassCreateLimit * more backstab to mob cleanup * add bot checks to tryheadshot / tryassassinate * adjust version number for bots * add back m_mob_check_moving_timer, necessary? * add sanity checks for classattacks * Get rid of Bots:BotGroupXP and change logic to support Bots:SameRaidGroupForXP Bots won't do anything if not in the same group so this should more accurately control only when in the same raid group. * add "confirm" check to ^delete * Update bot.cpp * Remove `id` from bot_settings, correct types * Implement blocked_buffs and blocked_pet_buffs * more blocked buff tweaks * add beneficial check to ^blockedbuffs * command grammar * missing ) * Move getnames for categories and settings to mob, rename hptomed/manatomed * add GetBotSpellCategoryIDByShortName and CopyBotBlockedPetBuffs, update ^defaultsettings command * cls cleanup * Allow bots to clear HasProjectIllusion flag * Add PercentChanceToCastGroupCure * Implmenet PetCures, add some missing types for defaults/chance to cast * Change GetRaidByBotName to GetRaidByBot * Typo on PetBuffs implement * Change GetSpellListSpellType to GetParentSpellType * missing from GetChanceToCastBySpellType * Fix performance in IsValidSpellRange by flipping HasProjectIllusion * merge with prev * merge with cls cleanup * Reorder IsTargetAlreadyReceivingSpell/CheckSpellLevelRestriction/IsBlockedBuff * Combine GatherGroupSpellTargets and GatherSpellTargets * Cleanup IsTargetAlreadyReceivingSpell * Fix ^petsettype to account for usable levels of spells and remove hardcoded level limits. * Remove Bot_AICheckCloseBeneficialSpells and use AttemptCloseBeneficialSpells for better performance * remove default hold for resist buffa * move IsValidSpellRange further down castchecks * raid optimizations * correct name checking to match players * more name checks and add proper soft deletes to bots * organize some checks in IsImmuneToBotSpell * Fix GetRaidByBotName and GetRaidByBot checks to not loop unnecessarily * Move GatherSpellTargets to mob * Change GetPrioritizedBotSpellsBySpellType to vector Some slipped through in "organize some checks in IsImmuneToBotSpell" * Move GatherSpellTargets and Raid to stored variables. Missing some in "organize some checks in IsImmuneToBotSpell" * comment out precheck, delays, thresholds, etc logging missed some in "organize some checks in IsImmuneToBotSpell" * Missing IsInGroupOrRaid cleanup * Implement AIBot_spells_by_type to reduce looping when searching for spells * Add _tempSpellType as placeholder for any future passthru * todo * Move bot_list from std::list to std::unordered_map like other entities * Fix missing raid assignment for GetStoredRaid in IsInGroupOrRaid * TempPet owned by bots that get the kill will now give exp like a client would * Remove unnecessary checks in bot process (closescanmoving timer, verify raid, send hp/mana/end packet * Fix client spell commands from saving the wrong setting * Cleanup ^copysettings command and add new commands * Add pet option to ^taunt No longer has toggle, required on/off option and an optional "pet" option to control pets' taunting state * Allow pet types to ^cast, prevent failure spam, add cure check * more raid optimizations, should be final. 10 clients, 710 bots, 10 raids, ~250 pets sits around 3.5% CPU idle * Move spell range check to proper location * Implement ^discipline * remove ^aggressive/^defensive * remove this for a separate PR * cleanup * Add BotGroupSay method * todo list * Add missing bot_blocked_buffs to schema * Remove plural on ^spelltypeidsand ^spelltypenames * Move spelltype names, spell subtypes, category names and setting names to maps. * move los checks to mob.cpp * Bot CampAll fix * Bots special_attacks.cpp fix * Add zero check for bot spawn limits If the spawn limit rule is set to 0 and spawn limit is set by bucket, if no class buckets are set, it defaults to the rule of 0 and renders the player unable to spawn bots. This adds a check where if the rule and class bucket are 0, it will check for the spawn limit bucket * Add HasSkill checks to bot special abilities (kick/bash/etc) * code cleanup 1 * code cleanup 2 * code cleanup 3 * code cleanup 4 * fix ^cast wirh commanded types * Remove bcspells, fix helper_send_usage_required_bots * linux build fix * remove completed todo * Allow inventory give to specific ID slots * Update TODO * Correct slot ranges for inventorygive * Add zone specific spawn limits and zone specific forced spawn limits * remove bd. from update queries where it doesn't exist * Rename _spellSettings to m_bot_spell_settings * Add IsPetOwnerOfClientBot(), add Lua and Perl methods * Make botOwnerCharacterID snakecase * Throw bot_camp_timer behind Bots:Enabled rule * Move various Bot<>Checks logging to BotSpellChecks * Remove from LogCategoryName * Consolidate IsInGroupOrRaid * Consolidate GatherSpellTargets * Add missing Bot Spell Type Checks to log * Add GetParentSpellType when checking spelltypes for idle, engaged, pursue CastChecks. * Consolidate AttemptForcedCastSpell * Consolidate SetBotBlockedBuff/SetBotBlockedPetBuff * Add list option to ^spellpriority commands. * Move client functions to client_bot * Move mob functions to mob_bot * Move bot spdat functions to spdat_bot * Move SendCommandHelpWindow to SendBotCommandHelpWindow and simplify * Change char_id to character_id for bot_settings * update todo * Fix typo on merge conflict * Cleanup command format changes, remove hardcoded class IDs in examples. * Set #illusionblock for players to guide access * Move client commands for bot spells from gm commands to existing bot commands * Fix alignment issues * More alignment fixes * More cleanup 1 * More cleanup 2 * Fix BotMeditate to med at proper percentages * Correct GetStopMeleeLevel checks for some buff checks * Add back hpmanaend update to bot raid, force timer update to prevent spamming * Remove log * Cleanup ranged and ammo calculations - Adds throwing check for match * Add check in distance calculations to stay at range if set even if no ammo or ranged * Move melee distance calculations to better function * Add GetBuffTargets helper * Missing p_item, s_item in CombatRangeInput * Linux test? * Reduce GetCorrectBotSpellType branching slightly This is still an ugly ass function but my brain is melted * Line fixes * Make bot pets only do half damage in pvp * Add bot pet pvp damage to tune * Add bot pet check for AIYellForHelp * Add bots to UseSpellImpliedTargeting * Move toggleranged, togglehelm and illusionblock to new help window. Add actionable support * Add bot and bot pet checks to various spells, auras and targeting checks that were missing. * update todo * New lines * Correct DoLosChecks * Remove Log TestDebug * Remove _Struct from struct declarations * Add bot check to IsAttackAllowed for GetUltimateOwner to skip entity list where possible * Wrap SaveBotSettings in Bots Enabled check * Remove comment * Wrap bot setting loading for clients in bots enabled rule * Cleanup BlockedBuffs logic in SpellOnTarget * Rename BotSpells_Struct/BotSpells_Struct_wIndex * Rename spawn/create status bypass rules, fix return for spawn limit * Remove unnecessary return in CanBuffStack, cleanup * Enable recastdelay support for clients * Remove unused variables * Rename _assistee to bot_assistee * hardcode BotCommandHelpWindow colors * todo * Fix ^cast summoncorpse * todo * Reimplement secondary colors to BotSendCommandHelpWindow * Give ^copysettings/^defaultsettings more options, cleanup. * Cleanup some commands * Add comment to CheckLosCheat/CheckLosCheatExempt * Make struct BotSpellSettings snake case * Allow duplicate casts of same spell on target for heals and cures * Add default delay to cures * Remove unused methods * Implement missing ^spellresistlimits/^resistlimits command * Move functions out of mob.h and cleanup * Return for GetRawBotList This checks offline bots too * Rename BotGroupSay to RaidGroupSay * Prevent bots from forming their own group if a bot that is a group leader is removed from the raid * Linux fix? * IsPetOwner fixes * Add remove option to list for ^blockedbuffs / ^blockedpetbuffs * Implement ^spellannouncecasts to toggle announcing casts of spell types * Remove rule Bots:BardsAnnounceCasts * Update bot.h * Remove unused no_pets option from GatherSpellTargets * Move ^attack response back to normal chat window (other) * Set lower limit of spell delays to 100 rather than 1 * Correct pet checks on GetUltimateSpell functions * Add rules (Bots, AICastSpellTypeDelay, Bots, AICastSpellTypeHeldDelay) to prevent spamming of failed spell type AI casts * Correct pet buff type logic to catch DS/Resists with other spell effects in them * Fix defaults for clients * Add more logic for necros/shaman for default heal thresholds due to lich and canni * Rename SpellHold, SpellDelay, SpellMinThreshold, SpellMaxThreshold, SpellRecastDelay to fit SpellType style naming * Use GetTempSpellType() for announce check in RaidGroupSay * Make all spell shortnames plural where applicable * Update bot.cpp * Bots:BotsUseLiveBlockedMessage filter to spell failure * Move GetSpellTargetList to only get called when necessary to reduce overhead * formatting * Formatting * Simplify case SE_Illusion and SE_IllusionCopy for GetIllusionBlock * Clean up InterruptSpell * Cleanup IsBot() checks for DetermineSpellTargets->ST_GroupClientAndPet * Cleanup range/aoe_range check in SpellFinished * Cleanup DetermineSpellTargets->ST_GroupNoPets * Cleanup DetermineSpellTargets->ST_Self for bot summon corpse * Cleanup DetermineSpellTargets->ST_Pet * Cleanup bot logic in TryBackstab * Cleanup IsAttackAllowed checks for bots and their pets * Cleanup StopMoving for bots * Cleanup CanThisClassTripleAttack * Fix casting for GetIllusionBlock checks * Formatting * Fix DetermineSpellTargets for group spells (this also wasn't properly checking the rule Character:EnableTGB in master) * Cleanup spelltarget grabbing logic, consolidate group heals in to GetNumberNeedingHealedInGroup * Throw added client los pet checks behind LoS cheat rule for bots * CLeanup give_exp on npc death logic and ensure client pets always pass. * Undo unintended rename from previous refactor * Remove pointless Bots, SameRaidGroupForXP rule * Revision to 0690783a9d1e99005d6bee0824597ea920e26df9 --------- Co-authored-by: Akkadius <akkadius1@gmail.com>
435 lines
11 KiB
C++
435 lines
11 KiB
C++
#include "bot.h"
|
|
#include "client.h"
|
|
|
|
bool Client::GetBotOption(BotOwnerOption boo) const {
|
|
if (boo < _booCount) {
|
|
return bot_owner_options[boo];
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
void Client::SetBotOption(BotOwnerOption boo, bool flag) {
|
|
if (boo < _booCount) {
|
|
bot_owner_options[boo] = flag;
|
|
}
|
|
}
|
|
|
|
uint32 Client::GetBotCreationLimit(uint8 class_id) {
|
|
uint32 bot_creation_limit = RuleI(Bots, CreationLimit);
|
|
|
|
if (Admin() >= RuleI(Bots, MinStatusToBypassCreateLimit)) {
|
|
return RuleI(Bots, MinStatusBypassCreateLimit);
|
|
}
|
|
|
|
const auto bucket_name = fmt::format(
|
|
"bot_creation_limit{}",
|
|
(
|
|
class_id && IsPlayerClass(class_id) ?
|
|
fmt::format(
|
|
"_{}",
|
|
Strings::ToLower(GetClassIDName(class_id))
|
|
) :
|
|
""
|
|
)
|
|
);
|
|
|
|
auto bucket_value = GetBucket(bucket_name);
|
|
if (!bucket_value.empty() && Strings::IsNumber(bucket_value)) {
|
|
bot_creation_limit = Strings::ToUnsignedInt(bucket_value);
|
|
}
|
|
|
|
return bot_creation_limit;
|
|
}
|
|
|
|
int Client::GetBotRequiredLevel(uint8 class_id) {
|
|
int bot_character_level = RuleI(Bots, BotCharacterLevel);
|
|
|
|
const auto bucket_name = fmt::format(
|
|
"bot_required_level{}",
|
|
(
|
|
class_id && IsPlayerClass(class_id) ?
|
|
fmt::format(
|
|
"_{}",
|
|
Strings::ToLower(GetClassIDName(class_id))
|
|
) :
|
|
""
|
|
)
|
|
);
|
|
|
|
auto bucket_value = GetBucket(bucket_name);
|
|
if (!bucket_value.empty() && Strings::IsNumber(bucket_value)) {
|
|
bot_character_level = Strings::ToInt(bucket_value);
|
|
}
|
|
|
|
return bot_character_level;
|
|
}
|
|
|
|
int Client::GetBotSpawnLimit(uint8 class_id) {
|
|
int bot_spawn_limit = RuleI(Bots, SpawnLimit);
|
|
|
|
if (Admin() >= RuleI(Bots, MinStatusToBypassSpawnLimit)) {
|
|
return RuleI(Bots, MinStatusBypassSpawnLimit);
|
|
}
|
|
|
|
const auto bucket_name = fmt::format(
|
|
"bot_spawn_limit{}",
|
|
(
|
|
class_id && IsPlayerClass(class_id) ?
|
|
fmt::format(
|
|
"_{}",
|
|
Strings::ToLower(GetClassIDName(class_id))
|
|
) :
|
|
""
|
|
)
|
|
);
|
|
|
|
auto bucket_value = GetBucket(bucket_name);
|
|
|
|
if (class_id && !bot_spawn_limit && bucket_value.empty()) {
|
|
const auto new_bucket_name = "bot_spawn_limit";
|
|
|
|
bucket_value = GetBucket(new_bucket_name);
|
|
|
|
if (!bucket_value.empty() && Strings::IsNumber(bucket_value)) {
|
|
bot_spawn_limit = Strings::ToInt(bucket_value);
|
|
|
|
return bot_spawn_limit;
|
|
}
|
|
}
|
|
|
|
if (!bucket_value.empty() && Strings::IsNumber(bucket_value)) {
|
|
bot_spawn_limit = Strings::ToInt(bucket_value);
|
|
}
|
|
|
|
if (RuleB(Bots, QuestableSpawnLimit)) {
|
|
const auto query = fmt::format(
|
|
"SELECT `value` FROM `quest_globals` WHERE `name` = '{}' AND `charid` = {} LIMIT 1",
|
|
bucket_name,
|
|
CharacterID()
|
|
);
|
|
|
|
auto results = database.QueryDatabase(query); // use 'database' for non-bot table calls
|
|
|
|
if (!results.Success() || !results.RowCount()) {
|
|
return bot_spawn_limit;
|
|
}
|
|
|
|
auto row = results.begin();
|
|
bot_spawn_limit = Strings::ToInt(row[0]);
|
|
}
|
|
|
|
const auto& zones_list = Strings::Split(RuleS(Bots, ZonesWithSpawnLimits), ",");
|
|
const auto& zones_limits_list = Strings::Split(RuleS(Bots, ZoneSpawnLimits), ",");
|
|
int i = 0;
|
|
|
|
for (const auto& result : zones_list) {
|
|
try {
|
|
if (
|
|
std::stoul(result) == zone->GetZoneID() &&
|
|
std::stoul(zones_limits_list[i]) < bot_spawn_limit
|
|
) {
|
|
bot_spawn_limit = std::stoul(zones_limits_list[i]);
|
|
|
|
break;
|
|
}
|
|
|
|
++i;
|
|
}
|
|
|
|
catch (const std::exception& e) {
|
|
LogInfo("Invalid entry in Rule VegasScaling:SpecialScalingZones or SpecialScalingZonesVersions: [{}]", e.what());
|
|
}
|
|
}
|
|
|
|
const auto& zones_forced_list = Strings::Split(RuleS(Bots, ZonesWithForcedSpawnLimits), ",");
|
|
const auto& zones_forced_limits_list = Strings::Split(RuleS(Bots, ZoneForcedSpawnLimits), ",");
|
|
i = 0;
|
|
|
|
for (const auto& result : zones_forced_list) {
|
|
try {
|
|
if (
|
|
std::stoul(result) == zone->GetZoneID() &&
|
|
std::stoul(zones_forced_limits_list[i]) != bot_spawn_limit
|
|
) {
|
|
bot_spawn_limit = std::stoul(zones_forced_limits_list[i]);
|
|
|
|
break;
|
|
}
|
|
|
|
++i;
|
|
}
|
|
|
|
catch (const std::exception& e) {
|
|
LogInfo("Invalid entry in Rule VegasScaling:SpecialScalingZones or SpecialScalingZonesVersions: [{}]", e.what());
|
|
}
|
|
}
|
|
|
|
return bot_spawn_limit;
|
|
}
|
|
|
|
void Client::SetBotCreationLimit(uint32 new_creation_limit, uint8 class_id) {
|
|
const auto bucket_name = fmt::format(
|
|
"bot_creation_limit{}",
|
|
(
|
|
class_id && IsPlayerClass(class_id) ?
|
|
fmt::format(
|
|
"_{}",
|
|
Strings::ToLower(GetClassIDName(class_id))
|
|
) :
|
|
""
|
|
)
|
|
);
|
|
|
|
SetBucket(bucket_name, std::to_string(new_creation_limit));
|
|
}
|
|
|
|
void Client::SetBotRequiredLevel(int new_required_level, uint8 class_id) {
|
|
const auto bucket_name = fmt::format(
|
|
"bot_required_level{}",
|
|
(
|
|
class_id && IsPlayerClass(class_id) ?
|
|
fmt::format(
|
|
"_{}",
|
|
Strings::ToLower(GetClassIDName(class_id))
|
|
) :
|
|
""
|
|
)
|
|
);
|
|
|
|
SetBucket(bucket_name, std::to_string(new_required_level));
|
|
}
|
|
|
|
void Client::SetBotSpawnLimit(int new_spawn_limit, uint8 class_id) {
|
|
const auto bucket_name = fmt::format(
|
|
"bot_spawn_limit{}",
|
|
(
|
|
class_id && IsPlayerClass(class_id) ?
|
|
fmt::format(
|
|
"_{}",
|
|
Strings::ToLower(GetClassIDName(class_id))
|
|
) :
|
|
""
|
|
)
|
|
);
|
|
|
|
SetBucket(bucket_name, std::to_string(new_spawn_limit));
|
|
}
|
|
|
|
void Client::CampAllBots(uint8 class_id) {
|
|
Bot::BotOrderCampAll(this, class_id);
|
|
}
|
|
|
|
void Client::LoadDefaultBotSettings() {
|
|
m_bot_spell_settings.clear();
|
|
|
|
// Only illusion block supported currently
|
|
SetBotSetting(BotSettingCategories::BaseSetting, BotBaseSettings::IllusionBlock, GetDefaultBotSettings(BotSettingCategories::BaseSetting, BotBaseSettings::IllusionBlock));
|
|
LogBotSettingsDetail("{} says, 'Setting default {} [{}] to [{}]'", GetCleanName(), CastToBot()->GetBotSettingCategoryName(BotBaseSettings::IllusionBlock), BotBaseSettings::IllusionBlock, GetDefaultBotSettings(BotSettingCategories::BaseSetting, BotBaseSettings::IllusionBlock));
|
|
|
|
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
|
|
BotSpellSettings t;
|
|
|
|
t.spell_type = i;
|
|
t.short_name = Bot::GetSpellTypeShortNameByID(i);
|
|
t.name = Bot::GetSpellTypeNameByID(i);
|
|
t.delay = GetDefaultSpellTypeDelay(i);
|
|
t.min_threshold = GetDefaultSpellTypeMinThreshold(i);
|
|
t.max_threshold = GetDefaultSpellTypeMaxThreshold(i);
|
|
t.recast_timer.Start();
|
|
|
|
m_bot_spell_settings.push_back(t);
|
|
|
|
LogBotSettingsDetail("{} says, 'Setting defaults for {} ({}) [#{}]'", GetCleanName(), t.name, t.short_name, t.spell_type);
|
|
LogBotSettingsDetail("{} says, 'Delay = [{}ms] | MinThreshold = [{}\%] | MaxThreshold = [{}\%]'", GetCleanName(),
|
|
GetDefaultSpellTypeDelay(i),
|
|
GetDefaultSpellTypeMinThreshold(i), GetDefaultSpellTypeMaxThreshold(i));
|
|
}
|
|
}
|
|
|
|
int Client::GetDefaultBotSettings(uint8 setting_type, uint16 bot_setting) {
|
|
switch (setting_type) {
|
|
case BotSettingCategories::BaseSetting:
|
|
return false; // only setting supported currently is illusion block
|
|
case BotSettingCategories::SpellDelay:
|
|
return GetDefaultSpellTypeDelay(bot_setting);
|
|
case BotSettingCategories::SpellMinThreshold:
|
|
return GetDefaultSpellTypeMinThreshold(bot_setting);
|
|
case BotSettingCategories::SpellMaxThreshold:
|
|
return GetDefaultSpellTypeMaxThreshold(bot_setting);
|
|
}
|
|
}
|
|
|
|
int Client::GetBotSetting(uint8 setting_type, uint16 bot_setting) {
|
|
switch (setting_type) {
|
|
case BotSettingCategories::BaseSetting:
|
|
return GetIllusionBlock(); // only setting supported currently
|
|
case BotSettingCategories::SpellDelay:
|
|
return GetSpellTypeDelay(bot_setting);
|
|
case BotSettingCategories::SpellMinThreshold:
|
|
return GetSpellTypeMinThreshold(bot_setting);
|
|
case BotSettingCategories::SpellMaxThreshold:
|
|
return GetSpellTypeMaxThreshold(bot_setting);
|
|
}
|
|
}
|
|
|
|
void Client::SetBotSetting(uint8 setting_type, uint16 bot_setting, uint32 setting_value) {
|
|
switch (setting_type) {
|
|
case BotSettingCategories::BaseSetting:
|
|
SetIllusionBlock(setting_value); // only setting supported currently
|
|
break;
|
|
case BotSettingCategories::SpellDelay:
|
|
SetSpellTypeDelay(bot_setting, setting_value);
|
|
break;
|
|
case BotSettingCategories::SpellMinThreshold:
|
|
SetSpellTypeMinThreshold(bot_setting, setting_value);
|
|
break;
|
|
case BotSettingCategories::SpellMaxThreshold:
|
|
SetSpellTypeMaxThreshold(bot_setting, setting_value);
|
|
break;
|
|
}
|
|
}
|
|
|
|
void Client::SendSpellTypePrompts(bool commanded_types, bool client_only_types) {
|
|
if (client_only_types) {
|
|
Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"You can view client spell types by {} or {}.",
|
|
Saylink::Silent(
|
|
fmt::format("^spelltypeids client"), "ID"
|
|
),
|
|
Saylink::Silent(
|
|
fmt::format("^spelltypenames client"), "Shortname"
|
|
)
|
|
).c_str()
|
|
);
|
|
}
|
|
else {
|
|
Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"You can view spell types by {}, {}, {} or by {}, {}, {}.",
|
|
Saylink::Silent(
|
|
fmt::format("^spelltypeids 0-19"), "ID 0-19"
|
|
),
|
|
Saylink::Silent(
|
|
fmt::format("^spelltypeids 20-39"), "20-39"
|
|
),
|
|
Saylink::Silent(
|
|
fmt::format("^spelltypeids 40+"), "40+"
|
|
),
|
|
Saylink::Silent(
|
|
fmt::format("^spelltypenames 0-19"), "Shortname 0-19"
|
|
),
|
|
Saylink::Silent(
|
|
fmt::format("^spelltypenames 20-39"), "20-39"
|
|
),
|
|
Saylink::Silent(
|
|
fmt::format("^spelltypenames 40+"), "40+"
|
|
)
|
|
).c_str()
|
|
);
|
|
}
|
|
|
|
if (commanded_types) {
|
|
Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"You can view commanded spell types by {} or {}.",
|
|
Saylink::Silent(
|
|
fmt::format("^spelltypeids commanded"), "ID"
|
|
),
|
|
Saylink::Silent(
|
|
fmt::format("^spelltypenames commanded"), "Shortname"
|
|
)
|
|
).c_str()
|
|
);
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
uint16 Client::GetDefaultSpellTypeDelay(uint16 spell_type) {
|
|
switch (spell_type) {
|
|
case BotSpellTypes::VeryFastHeals:
|
|
case BotSpellTypes::PetVeryFastHeals:
|
|
return 1500;
|
|
case BotSpellTypes::FastHeals:
|
|
case BotSpellTypes::PetFastHeals:
|
|
return 2500;
|
|
case BotSpellTypes::GroupHeals:
|
|
case BotSpellTypes::RegularHeal:
|
|
case BotSpellTypes::PetRegularHeals:
|
|
return 4000;
|
|
case BotSpellTypes::CompleteHeal:
|
|
case BotSpellTypes::GroupCompleteHeals:
|
|
case BotSpellTypes::PetCompleteHeals:
|
|
return 8000;
|
|
case BotSpellTypes::GroupHoTHeals:
|
|
case BotSpellTypes::HoTHeals:
|
|
case BotSpellTypes::PetHoTHeals:
|
|
return 22000;
|
|
case BotSpellTypes::Cure:
|
|
return 2000;
|
|
case BotSpellTypes::GroupCures:
|
|
return 3000;
|
|
case BotSpellTypes::PetCures:
|
|
return 5000;
|
|
default:
|
|
return 100;
|
|
}
|
|
}
|
|
|
|
uint8 Client::GetDefaultSpellTypeMinThreshold(uint16 spell_type) {
|
|
switch (spell_type) {
|
|
default:
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
uint8 Client::GetDefaultSpellTypeMaxThreshold(uint16 spell_type) {
|
|
uint8 client_class = GetClass();
|
|
|
|
switch (spell_type) {
|
|
case BotSpellTypes::VeryFastHeals:
|
|
case BotSpellTypes::PetVeryFastHeals:
|
|
return 25;
|
|
case BotSpellTypes::FastHeals:
|
|
case BotSpellTypes::PetFastHeals:
|
|
return 40;
|
|
case BotSpellTypes::GroupHeals:
|
|
case BotSpellTypes::RegularHeal:
|
|
case BotSpellTypes::PetRegularHeals:
|
|
return 60;
|
|
case BotSpellTypes::CompleteHeal:
|
|
case BotSpellTypes::GroupCompleteHeals:
|
|
case BotSpellTypes::PetCompleteHeals:
|
|
if (client_class == Class::Necromancer || client_class == Class::Shaman) {
|
|
return 55;
|
|
}
|
|
else {
|
|
return 80;
|
|
}
|
|
case BotSpellTypes::GroupHoTHeals:
|
|
case BotSpellTypes::HoTHeals:
|
|
case BotSpellTypes::PetHoTHeals:
|
|
if (client_class == Class::Necromancer || client_class == Class::Shaman) {
|
|
return 70;
|
|
}
|
|
else {
|
|
return 90;
|
|
}
|
|
case BotSpellTypes::Buff:
|
|
case BotSpellTypes::Cure:
|
|
case BotSpellTypes::GroupCures:
|
|
case BotSpellTypes::PetCures:
|
|
case BotSpellTypes::PetBuffs:
|
|
case BotSpellTypes::PetDamageShields:
|
|
case BotSpellTypes::PetResistBuffs:
|
|
case BotSpellTypes::ResistBuffs:
|
|
default:
|
|
return 100;
|
|
}
|
|
}
|