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
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 786 - File: showthread.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/showthread.php 786 errorHandler->error






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stop damage/ARGN1 if...
Author Message
Lano
Apprentice
*

Posts: 28
Likes Given: 3
Likes Received: 0 in 0 posts
Joined: Oct 2012
Reputation: 0



Post: #1
Stop damage/ARGN1 if...
Hello, maybe its getting late or I am just plain stupid.
Below a part of a system i am working on, where willpower and toughness act as a magic- and physical-shield on NPC's. Toughness is decreased/destroyd with physical damage, and Willpower with magical damage.

Willpower and Toughness gets assigned when the NPC is created (on=@create) based on their skills (magery, swordsmanship, etc.), stats and armor values..

Once created , players have to bring either the NPCS willpower or Toughness to 0% before they can start giving direct damage to the hitpoints (and on the hitpoints elemental-resistances still play in)

So its basically just another layer of fun and tactics for PVE.
However, I sliced up my "ON=@GETHIT" script to get some help... see below.

I need to blockout the damage to hitpoints, untill either willpower or toughness is at zero .. and truely, i could not figure out where to place the "Return 1"
Either they took no dmg at all, or all the time...


ON=@GETHIT
IF (<ARGN2> & dam_magic)&&(<eval <tag.magicalshield>> >= 0)
sfx 952
EFFECT 3 i_fx_sparkle_2, 16, 16
tag.magicalshield=<eval <tag.magicalshield>> -<ARGN1>
resendtooltip=1
--> Return 1 here does nothing... NPC still takes hitpoint dmg.

ELSEIF (<ARGN2> & dam_physical)&&(<eval <tag.defenseshield>> >= 0)
EFFECT 3 i_fx_curse, 16, 16
tag.defenseshield=<eval <tag.defenseshield>> -<ARGN1>
resendtooltip=1
dorand = 3
sfx 952
sfx 953
sfx 954

IF (<eval <tag.defenseshield>> <= 1)
tag.lifeleft <eval <muldiv <hits>,100,<maxhits>>>
tag.defenseshield <eval <tag.defenseshield>>
tag.magicalshield <eval <tag.magicalshield>>
UPDATE 1
resendtooltip=1

ELSEIF (<eval <tag.magicalshield>> <= 1)
tag.lifeleft <eval <muldiv <hits>,100,<maxhits>>>
tag.defenseshield <eval <tag.defenseshield>>
tag.magicalshield <eval <tag.magicalshield>>
UPDATE 1
resendtooltip=1
ENDIF
--> Return 1 here blocks hitpoint damage totally...

Oh and if you tell me, that script is old, and slow and heavy on the server, please feel free to show me how to make it better (been away from sphere for some years)
(This post was last modified: 08-17-2018 08:02 AM by Lano.)
08-17-2018 08:00 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Stop damage/ARGN1 if... - Lano - 08-17-2018 08:00 AM
RE: Stop damage/ARGN1 if... - Artyk - 08-17-2018, 09:28 AM
RE: Stop damage/ARGN1 if... - Coruja - 08-17-2018, 02:14 PM
RE: Stop damage/ARGN1 if... - Lano - 08-17-2018, 04:23 PM

Forum Jump:


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