feat(Core/Config): Infinite ammo config setting (#22969)

Co-authored-by: sogladev <sogladev@gmail.com>
This commit is contained in:
Degen
2025-09-23 21:46:04 -03:00
committed by GitHub
parent ae5001d16e
commit d05213d85e
4 changed files with 14 additions and 3 deletions

View File

@@ -4563,6 +4563,13 @@ MunchingBlizzlike.Enabled = 1
Daze.Enabled = 1
#
# InfiniteAmmo.Enabled
# Description: Enable or disable ammo consumption for ranged attacks and thrown weapons.
# Default: 0 - (Blizzlike)
InfiniteAmmo.Enabled = 0
#
###################################################################################################

View File

@@ -5422,15 +5422,16 @@ void Spell::TakeAmmo()
// decrease durability for non-stackable throw weapon
m_caster->ToPlayer()->DurabilityPointLossForEquipSlot(EQUIPMENT_SLOT_RANGED);
}
else
else if (!sWorld->getBoolConfig(CONFIG_ENABLE_INFINITEAMMO))
{
// decrease items amount for stackable throw weapon
uint32 count = 1;
m_caster->ToPlayer()->DestroyItemCount(pItem, count, true);
}
}
else if (uint32 ammo = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID))
m_caster->ToPlayer()->DestroyItemCount(ammo, 1, true);
else if (!sWorld->getBoolConfig(CONFIG_ENABLE_INFINITEAMMO))
if (uint32 ammo = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID))
m_caster->ToPlayer()->DestroyItemCount(ammo, 1, true);
}
}

View File

@@ -505,6 +505,8 @@ void WorldConfig::BuildConfigCache()
SetConfigValue<bool>(CONFIG_ENABLE_DAZE, "Daze.Enabled", true);
SetConfigValue<bool>(CONFIG_ENABLE_INFINITEAMMO, "InfiniteAmmo.Enabled", false);
SetConfigValue<uint32>(CONFIG_DAILY_RBG_MIN_LEVEL_AP_REWARD, "DailyRBGArenaPoints.MinLevel", 71);
// Respawn

View File

@@ -142,6 +142,7 @@ enum ServerConfigs
CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH,
CONFIG_MUNCHING_BLIZZLIKE,
CONFIG_ENABLE_DAZE,
CONFIG_ENABLE_INFINITEAMMO,
CONFIG_SPELL_QUEUE_ENABLED,
CONFIG_GROUP_XP_DISTANCE,
CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE,