Skip to content

Commit

Permalink
Added missing modifier enums.
Browse files Browse the repository at this point in the history
  • Loading branch information
Codinablack committed Dec 1, 2024
1 parent c370516 commit a0a75ca
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
1 change: 0 additions & 1 deletion data/scripts/#discord.lua

This file was deleted.

3 changes: 2 additions & 1 deletion src/damagemodifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ enum ModifierDefenseType : uint8_t {
DEFENSE_MODIFIER_RESIST, // damage reduction
DEFENSE_MODIFIER_REFORM, // convert damage to another type

DEFENSE_MODIFIER_LAST
DEFENSE_MODIFIER_FIRST = DEFENSE_MODIFIER_NONE,
DEFENSE_MODIFIER_LAST = DEFENSE_MODIFIER_REFORM
};

enum ModFactor : uint8_t {
Expand Down
32 changes: 32 additions & 0 deletions src/luascript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,12 @@ void LuaScriptInterface::registerFunctions()
registerEnum(CREATURETYPE_NPC)
registerEnum(CREATURETYPE_SUMMON_OWN)
registerEnum(CREATURETYPE_SUMMON_HOSTILE)
registerEnum(CREATURETYPE_SUMMON_GUILD)
registerEnum(CREATURETYPE_SUMMON_PARTY)
registerEnum(CREATURETYPE_BOSS)
registerEnum(CREATURETYPE_SUMMON_HOSTILE)
registerEnum(CREATURETYPE_ATTACKABLE)
registerEnum(CREATURETYPE_SUMMON_ALL)

registerEnum(CLIENTOS_LINUX)
registerEnum(CLIENTOS_WINDOWS)
Expand Down Expand Up @@ -1985,6 +1991,32 @@ void LuaScriptInterface::registerFunctions()
registerEnum(DiscordMessageType::MESSAGE_LOG);
registerEnum(DiscordMessageType::MESSAGE_INFO);

// Attack Modifiers
registerEnum(ATTACK_MODIFIER_FIRST)
registerEnum(ATTACK_MODIFIER_NONE)
registerEnum(ATTACK_MODIFIER_LIFESTEAL)
registerEnum(ATTACK_MODIFIER_MANASTEAL)
registerEnum(ATTACK_MODIFIER_STAMINASTEAL)
registerEnum(ATTACK_MODIFIER_SOULSTEAL)
registerEnum(ATTACK_MODIFIER_CRITICAL)
registerEnum(ATTACK_MODIFIER_PIERCING)
registerEnum(ATTACK_MODIFIER_CONVERSION)
registerEnum(ATTACK_MODIFIER_LAST)

// Defense Modifiers
registerEnum(DEFENSE_MODIFIER_FIRST)
registerEnum(DEFENSE_MODIFIER_NONE)
registerEnum(DEFENSE_MODIFIER_ABSORB)
registerEnum(DEFENSE_MODIFIER_RESTORE)
registerEnum(DEFENSE_MODIFIER_REPLENISH)
registerEnum(DEFENSE_MODIFIER_REVIVE)
registerEnum(DEFENSE_MODIFIER_REFLECT)
registerEnum(DEFENSE_MODIFIER_DEFLECT)
registerEnum(DEFENSE_MODIFIER_RICOCHET)
registerEnum(DEFENSE_MODIFIER_RESIST)
registerEnum(DEFENSE_MODIFIER_RESIST)
registerEnum(DEFENSE_MODIFIER_LAST)

// _G
registerGlobalVariable("INDEX_WHEREEVER", INDEX_WHEREEVER);
registerGlobalBoolean("VIRTUAL_PARENT", true);
Expand Down
2 changes: 1 addition & 1 deletion src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6016,7 +6016,7 @@ std::unordered_map<uint8_t, ModifierTotals> Player::getDefenseModifierTotals(con
modMap.reserve(DEFENSE_MODIFIER_LAST);

auto defenseMods = getDefenseModifiers();
for (uint8_t i = DEFENSE_MODIFIER_NONE; i < DEFENSE_MODIFIER_LAST; ++i) {
for (uint8_t i = DEFENSE_MODIFIER_FIRST; i < DEFENSE_MODIFIER_LAST; ++i) {
auto modTotals = getValidatedTotals(defenseMods[i], damageType, originType, creatureType, race, creatureName);
modMap.try_emplace(i, modTotals);
}
Expand Down

0 comments on commit a0a75ca

Please sign in to comment.