mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
feat(Core/Config): Infinite ammo config setting (#22969)
Co-authored-by: sogladev <sogladev@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user