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
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 


Messages In This Thread
Absorbed Damage - EOSCPM - 04-21-2015, 03:29 PM
RE: Absorbed Damage - Extreme - 04-21-2015, 03:49 PM
RE: Absorbed Damage - EOSCPM - 04-21-2015, 03:53 PM
RE: Absorbed Damage - Coruja - 04-22-2015, 10:28 AM
RE: Absorbed Damage - Extreme - 04-22-2015, 10:31 PM
RE: Absorbed Damage - UltimaAku - 04-27-2015 03:56 AM

Forum Jump:


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