[Server] Actually, turn SetAttributeModifier into ClearAttributeModifier

There's no way SetAttributeModifier() was going to make sense if, say, a player had drunk 3 different potions fortifying the same attribute and was wearing equipment fortifying it as well. How would one change the sum modifier of those while accounting for each specific effect's duration and magnitude?

The only workable solution is to allow the server to clear the modifier.
0.6.2
David Cernat 7 years ago
parent ef6dc61797
commit 2944be18ae

@ -431,7 +431,7 @@ void StatsFunctions::SetAttributeBase(unsigned short pid, unsigned short attribu
player->creatureStats.mAttributes[attribute].mBase = value;
}
void StatsFunctions::SetAttributeModifier(unsigned short pid, unsigned short attribute, int value) noexcept
void StatsFunctions::ClearAttributeModifier(unsigned short pid, unsigned short attribute) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -439,7 +439,7 @@ void StatsFunctions::SetAttributeModifier(unsigned short pid, unsigned short att
if (attribute >= Attribute::Length)
return;
player->creatureStats.mAttributes[attribute].mMod = value;
player->creatureStats.mAttributes[attribute].mMod = 0;
}
void StatsFunctions::SetSkillBase(unsigned short pid, unsigned short skill, int value) noexcept //TODO: need packet for one value

@ -64,7 +64,7 @@
{"SetFatigueCurrent", StatsFunctions::SetFatigueCurrent},\
\
{"SetAttributeBase", StatsFunctions::SetAttributeBase},\
{"SetAttributeModifier", StatsFunctions::SetAttributeModifier},\
{"ClearAttributeModifier", StatsFunctions::ClearAttributeModifier},\
\
{"SetSkillBase", StatsFunctions::SetSkillBase},\
{"SetSkillCurrent", StatsFunctions::SetSkillCurrent},\
@ -141,7 +141,7 @@ public:
static void SetFatigueCurrent(unsigned short pid, double value) noexcept;
static void SetAttributeBase(unsigned short pid, unsigned short attribute, int value) noexcept;
static void SetAttributeModifier(unsigned short pid, unsigned short attribute, int value) noexcept;
static void ClearAttributeModifier(unsigned short pid, unsigned short attribute) noexcept;
static void SetSkillBase(unsigned short pid, unsigned short skill, int value) noexcept;
static void SetSkillCurrent(unsigned short pid, unsigned short skill, int value) noexcept;

Loading…
Cancel
Save