RUNUO - Player's total resistances

Finaltwist

Squire
Good evening all,

Im faced with a little puzzle and im not sure how to solve it.

I have a public static variable for the server that changes based on player interaction.
I'd like every players' resistances (physical, cold etc) to be affected by this variable.

Problem is, methods like updateresistances and computeresistances are all core methods in mobile.cs so i can't modify the core to include the public static variable.

How would i go about modifying the player's resistances in this instances? Also, I'd like the modification to affect the TOTAL resistance amounts of the player (not just the players resistance that is stored in player.physicalresistance - that variable is capped at 70. If a player has 100 phys resist, i'd like to modify the 100 amount, not the 70).

If I were to override the computeresistances method in playermobile class, would that be the right approach?
 

Lokai

Moderator
ServUO Developer
Yes. Overriding the method in PlayerMobile would give you access to the static variable.
 

Finaltwist

Squire
Yes. Overriding the method in PlayerMobile would give you access to the static variable.
If i override it in player mobile, would the references to the method in mobile class point to the override or would i need to change every reference to it?

E. G. if a script uses ((Mobile)player).computeresistances() will the override in playermobile be called on?
 

Lokai

Moderator
ServUO Developer
Yes. If player is a PlayerMobile, then it will automatically use the override.