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
poison spell/combat
Author Message
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #10
RE: poison spell/combat
The formula is taken from the source, https://github.com/Sphereserver/Source/b....cpp#L122, check case 1

In case of combat and if understand it well, actdiff is the threshold number that is compared to a "random roll" made by Sphere after/in the @Start trigger.

If the random roll (from to 0 to 999) is more or equal than actdiff, then the action is succesfull (pay attention that while you can change the actdiff value by script, you don't have access to the random roll value made by Sphere).

So in the @Start trigger:

actdiff= 0 always success
actdiff >= 1000 always fail.

In the @HitTry trigger the result is already calculated and Sphere already know if the hit will be a miss or a success.
If it's a fail, the actdiff value will be negative.
If it's a success the actdiff value will remain positive.
Example:
We set actdiff in @Start with a value of 10 (very easy)
In the @HitTry we log the actdiff and we see that actdiff is -10, that means we actually miss the target.


Summary:
Increasing the actdiff value in the @Start trigger of a skill will actually make the action more difficult.
Increasing the actdiff value in the @HitTry trigger does nothing (unless you change it to a positive number from a negative number)

Anyway you can make your own formula in @HitTry for overriding the results, also in the @HitMiss trigger if you change the actdiff value to a positive number it will still trigger a succesfull hit!
(This post was last modified: 03-30-2017 08:22 PM by darksun84.)
03-30-2017 08:21 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
poison spell/combat - richm - 03-28-2017, 06:55 AM
RE: poison spell/combat - Van Glan Bloom - 03-28-2017, 07:38 AM
RE: poison spell/combat - richm - 03-28-2017, 07:30 PM
RE: poison spell/combat - richm - 03-29-2017, 06:38 AM
RE: poison spell/combat - richm - 03-29-2017, 09:52 PM
RE: poison spell/combat - Rostok - 03-29-2017, 10:17 PM
RE: poison spell/combat - darksun84 - 03-29-2017, 10:24 PM
RE: poison spell/combat - richm - 03-29-2017, 10:32 PM
RE: poison spell/combat - richm - 03-30-2017, 06:50 AM
RE: poison spell/combat - darksun84 - 03-30-2017 08:21 PM
RE: poison spell/combat - richm - 04-02-2017, 03:31 AM
RE: poison spell/combat - richm - 04-05-2017, 06:55 AM

Forum Jump:


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