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
|
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
|
// decrease durability for non-stackable throw weapon
|
||||||
m_caster->ToPlayer()->DurabilityPointLossForEquipSlot(EQUIPMENT_SLOT_RANGED);
|
m_caster->ToPlayer()->DurabilityPointLossForEquipSlot(EQUIPMENT_SLOT_RANGED);
|
||||||
}
|
}
|
||||||
else
|
else if (!sWorld->getBoolConfig(CONFIG_ENABLE_INFINITEAMMO))
|
||||||
{
|
{
|
||||||
// decrease items amount for stackable throw weapon
|
// decrease items amount for stackable throw weapon
|
||||||
uint32 count = 1;
|
uint32 count = 1;
|
||||||
m_caster->ToPlayer()->DestroyItemCount(pItem, count, true);
|
m_caster->ToPlayer()->DestroyItemCount(pItem, count, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (uint32 ammo = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID))
|
else if (!sWorld->getBoolConfig(CONFIG_ENABLE_INFINITEAMMO))
|
||||||
m_caster->ToPlayer()->DestroyItemCount(ammo, 1, true);
|
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_DAZE, "Daze.Enabled", true);
|
||||||
|
|
||||||
|
SetConfigValue<bool>(CONFIG_ENABLE_INFINITEAMMO, "InfiniteAmmo.Enabled", false);
|
||||||
|
|
||||||
SetConfigValue<uint32>(CONFIG_DAILY_RBG_MIN_LEVEL_AP_REWARD, "DailyRBGArenaPoints.MinLevel", 71);
|
SetConfigValue<uint32>(CONFIG_DAILY_RBG_MIN_LEVEL_AP_REWARD, "DailyRBGArenaPoints.MinLevel", 71);
|
||||||
|
|
||||||
// Respawn
|
// Respawn
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ enum ServerConfigs
|
|||||||
CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH,
|
CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH,
|
||||||
CONFIG_MUNCHING_BLIZZLIKE,
|
CONFIG_MUNCHING_BLIZZLIKE,
|
||||||
CONFIG_ENABLE_DAZE,
|
CONFIG_ENABLE_DAZE,
|
||||||
|
CONFIG_ENABLE_INFINITEAMMO,
|
||||||
CONFIG_SPELL_QUEUE_ENABLED,
|
CONFIG_SPELL_QUEUE_ENABLED,
|
||||||
CONFIG_GROUP_XP_DISTANCE,
|
CONFIG_GROUP_XP_DISTANCE,
|
||||||
CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE,
|
CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE,
|
||||||
|
|||||||
Reference in New Issue
Block a user