TempusMUD / Tempuscode

Codebase for TempusMUD
http://tempusmud.com/
Other
7 stars 6 forks source link

Objects that apply skill modifiers can permanently change skill #296

Open mikeclemson opened 10 years ago

mikeclemson commented 10 years ago

Here's a tracking message for a player at low skill that adds some modifier from apply. Works normally. (For some reason, even though the item doesn't apply damroll, it still processes other equipment as though it removed/reequipped by this action.) Fri Apr 4 13:16:11 :: Backstab skill is 22 to start. About to add 57 mod. Fri Apr 4 13:16:11 :: Backstab skill is now at 79. Fri Apr 4 13:16:11 :: Backstab skill is 79 to start. About to add -57 mod. Fri Apr 4 13:16:11 :: Backstab skill is now at 22. Fri Apr 4 13:16:11 :: Damroll is 5 to start. About to add -5 mod. Fri Apr 4 13:16:11 :: Damroll is now at 0. Fri Apr 4 13:16:11 :: Backstab skill is 22 to start. About to add 57 mod. Fri Apr 4 13:16:11 :: Backstab skill is now at 79. Fri Apr 4 13:16:11 :: Damroll is 0 to start. About to add 5 mod. Fri Apr 4 13:16:11 :: Damroll is now at 5.

But look what happens if skill is at 110 to start and they wear something that gives 25 skill: Fri Apr 4 13:19:25 :: Grimpy changed Magey's backstab to 110. Fri Apr 4 13:19:28 :: Backstab skill is 110 to start. About to add 25 mod. Fri Apr 4 13:19:28 :: Backstab skill is now at 125. Fri Apr 4 13:19:28 :: Backstab skill is 125 to start. About to add -25 mod. Fri Apr 4 13:19:28 :: Backstab skill is now at 100. Fri Apr 4 13:19:28 :: Backstab skill is 100 to start. About to add 25 mod. Fri Apr 4 13:19:28 :: Backstab skill is now at 125. And then the player removes the object: Fri Apr 4 13:19:54 :: Backstab skill is 125 to start. About to add -25 mod. Fri Apr 4 13:19:54 :: Backstab skill is now at 100.

Skill is just being set to the MIN of skill + modifier or 125, so if skill is 110 and modifier is 25, 125 is less than 135 so skill is set to 125. Then when the 25 apply from EQ is removed they are brought down to 100. Not terribly urgent, but interesting.

mikeclemson commented 10 years ago

Oops, didn't mean to close. Also: to resolve this, should I allow skill integers higher than 125, then set GET_SKILL() and similar to only get at most 125?

mikeclemson commented 10 years ago

skill is defined as int8_t in creature.h. age_adjust, which I could see being a large number, larger than 127. If we adjusted skills, weapon_proficiency might also need to change.