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
Absorbed Damage
Author Message
EOSCPM
Apprentice
*

Posts: 22
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2014
Reputation: 0



Post: #1
Absorbed Damage
Hi,

How can i control absorbed damage ?

When a player hit to another player this attack really dealt damage ?.

i used @Hit trigger but it just giving me amount of damage. May another player absorb all damage but i can' learn.

Thank you.
04-21-2015 03:29 PM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #2
RE: Absorbed Damage
Try @GetHit Big Grin

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
04-21-2015 03:49 PM
Find all posts by this user Like Post Quote this message in a reply
EOSCPM
Apprentice
*

Posts: 22
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2014
Reputation: 0



Post: #3
RE: Absorbed Damage
I know, but i have an event and i need the get value when i hit, not when i hitted.
(This post was last modified: 04-21-2015 03:53 PM by EOSCPM.)
04-21-2015 03:53 PM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

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

Dimension Shard

Post: #4
RE: Absorbed Damage
damage always have 2 parts: damage before resist (@Hit) and damage after resist (@GetHit)

so the damage before resist is handled by @Hit, which does all damage calculations

and then the attacker will hit the target with this damage value (already calculated) and now @GetHit is called to apply resist calculations
04-22-2015 10:28 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #5
RE: Absorbed Damage
Basicaly is:
@Hit - Calculate the raw damage to apply on enemy.
@GetHit - Receive the raw damage of @Hit and calculate the damage to absorb.

Example:
Code:
ON=@HIT
ARGN1 <R<WEAPON.DAM>>
ON=@GETHIT
ARGN1 -= <EVAL (<ARGN1>*<AC>)/100>

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
04-22-2015 10:31 PM
Find all posts by this user Like Post Quote this message in a reply
UltimaAku
Journeyman
*

Posts: 125
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 1



Post: #6
RE: Absorbed Damage
I don't quite know what your after. Are you after a weapon that sometimes guarantees 0 damage?

[EVENTS e_nodmg]

ON=@HIT
VAR.RAND=<EVAL {1 100}>
IF (<VAR.RAND><=20) //20% chance of happening
SYSMESSAGE Your attack just bounced off
RETURN 1
ELSE
RETURN 0
ENDIF

then add this to a weapon

ON=@EQUIP
SRC.EVENTS=+e_nodmg

ON=@UNEQUIP
SRC.EVENTS=-e_nodmg

If you want to control the damage dealt (e.g. make it do half damage against players and full damage on npcs) then try this:

[EVENTS e_pvpdrop]

ON=@HIT
IF (<SRC.BRAIN>=0) //It's a human
ARGN1=(<ARGN1>/2) //Reduces the damage dealt by half against players
ELSE
RETURN 0 //everything else receives full damage
ENDIF

then apply that to an @equip

ON=@EQUIP
SRC.EVENTS=+e_pvpdrop

ON=@UNEQUIP
SRC.EVENTS=-e_pvpdrop

Personally, I don't see a point on making this player-related. Armour and resistances does it for you already. It's a neat idea if you was making "bane" weapons that deal extra damage against certain mobs (e.g. orc bane doubles damage against orcs).
(This post was last modified: 04-27-2015 04:07 AM by UltimaAku.)
04-27-2015 03:56 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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