The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom armor rating calculation
Author Message
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #6
RE: Custom armor rating calculation
maybe "damage * (200 - AR) / 200" should do the trick if you want use max AR value of 200

that's exactly the same way how elemental damages are calculated:
Code:
damage type * (100 - resist type) / 100
of course the main difference is that on elemental combat you must split the single damage into all 5 types (physical/fire/cold/poison/energy) to calculate each value and then add all the 5 results into the final damage. Clients also have RESPHYSICALMAX/RESFIREMAX/etc that will limit char max resist value (75 by default) to prevent them reach resist >= 100 and break the formula. 75 is a nice limit because even at maximum resist ppl still get 25% of the damage. Using old AR there's no MAXAR property so you must do something like this on your code, because if the max AR is 200, it's not a good idea let ppl have 200 AR to make them immortal always resisting 100% of all damages

also if you want to skip sphere internal resist calculations to calculate using your own formula on @GetHit, don't forget to add damage type "dam_fixed" on your @Hit trigger and all other sources of damage, like spells ("LOCAL.DamType |= dam_fixed" on @Effect / @SpellEffect), custom scripts (using DAMAGE 10 dam_fixed), etc
(This post was last modified: 05-17-2017 02:32 PM by Coruja.)
05-17-2017 02:28 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Custom armor rating calculation - Murmur - 05-10-2017, 05:00 PM
RE: Custom armor rating calculation - Coruja - 05-17-2017 02:28 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)