Finaltwist

Member
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?
 
Yes. Overriding the method in PlayerMobile would give you access to the static variable.
 
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?
 

Active Shards

  • Unchained
    Custom (Classic)
    • Players
    • 142 Online
    • 273 Peak
  • UO Eventine
    Custom (Classic)
    • Players
    • 88 Online
    • 137 Peak
  • The Crossroads
    Mondain's Legacy
    • Players
    • 86 Online
    • 190 Peak
  • Insane UO
    Endless Journey
    • Players
    • 83 Online
    • 105 Peak
  • UO: New Renaissance
    Custom (Classic)
    • Players
    • 31 Online
    • 85 Peak
  • CALYPSO
    Custom (Modern)
    • Players
    • 22 Online
    • 30 Peak
  • Arth
    Custom (Modern)
    • Players
    • 22 Online
    • 34 Peak
  • UO Enigma
    Custom (Modern)
    • Players
    • 20 Online
    • 172 Peak
  • Heritage
    New Legacy
    • Players
    • 19 Online
    • 41 Peak
  • UO Phoenix
    Custom (Classic)
    • Players
    • 19 Online
    • 48 Peak

Donations

Total amount
$0.00
Goal
$500.00
Back