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
Lowering Stats with Hits
Author Message
Nachtmusique
Journeyman
*

Posts: 89
Likes Given: 0
Likes Received: 6 in 6 posts
Joined: Mar 2012
Reputation: 0



Post: #1
Lowering Stats with Hits
Hello,

I feel like this should be a simple thing, but for some reason I can't seem to wrap my mind around it. I would like to lower a character's stats (STR, DEX, and INT) as his hits are lowered as a percentage. For example:

If a character has the following stats:

100 Maxhits
100 STR
50 DEX
75 INT

and he takes 20 damage, it should drop his stats to:

80 STR
40 DEX
60 INT

This would be easy to do in isolation, however I need Bless and curse spells to still operate correctly and I need the stats to rise incrementally as the Hits regenerate. I'm not asking anyone to script this FOR me, just help point me in the right direction.

Thanks
03-04-2015 03:05 PM
Find all posts by this user Like Post Quote this message in a reply
Artyk
Journeyman
*

Posts: 75
Likes Given: 43
Likes Received: 9 in 9 posts
Joined: Sep 2014
Reputation: 0



Post: #2
RE: Lowering Stats with Hits
What i would do:
Use MODDEX, MODINT, MODSTR to set the changes to the stats (always add or subtract, do not directly set them beacause those are used by spells too)
Use @GetHit to modify stats as hits go down
Use @RegenStat to change stats as hits are regened
Use @Death to reset stats modifiers
Remember to store initial max hits as it will change on str change
03-04-2015 10:58 PM
Find all posts by this user Like Post Quote this message in a reply
Nachtmusique
Journeyman
*

Posts: 89
Likes Given: 0
Likes Received: 6 in 6 posts
Joined: Mar 2012
Reputation: 0



Post: #3
RE: Lowering Stats with Hits
Thanks a bunch, this seems to have worked:

[events e_wounds_combat]
on=@statchange
//say change! <ARGN1>
IF (<ARGN1>==0)||(<ARGN1>==2)||(<ARGN1>==8)||(<ARGN1>==10)
timerf 0 fixmaxstam
ENDIF

on=@regenstat
IF (<LOCAL.STATID>==0)
LOCAL.POH=<eval ((<HITS> + <local.Value>)*100)/<MAXHITS>> //HP as a % of MAXHITS

//STR

LOCAL.HBSTR = <eval (<OSTR>*<local.POH>)/100>
IF !(<tag.HBSTR>==<LOCAL.HBSTR>)
MODSTR=<eval (<MODSTR> + (<local.hbstr>-<TAG.HBSTR>))>
TAG.HBSTR=<LOCAL.HBSTR>
ENDIF

//DEX
LOCAL.HBDEX = <eval (<ODEX>*<local.POH>)/100>
IF !(<tag.HBDEX>==<LOCAL.HBDEX>)
MODDEX=<eval (<MODDEX> + (<local.hbdex>-<TAG.HBDEX>))>
TAG.HBDEX=<LOCAL.HBDEX>
ENDIF

//INT
LOCAL.HBINT = <eval (<OINT>*<local.POH>)/100>
IF !(<tag.HBINT>==<LOCAL.HBINT>)
MODINT=<eval (<MODINT> + (<local.hbint>-<TAG.HBINT>))>
TAG.HBINT=<LOCAL.HBINT>
ENDIF
WAKECHECK
ENDIF

on=@gethit
IF (<FLAGS> & statf_stone)
RETURN 1
ENDIF

LOCAL.POH=<eval ((<HITS> - <argn1>)*100)/<MAXHITS>> //HP as a % of MAXHITS

//STR
LOCAL.HBSTR = <eval (<OSTR>*<local.POH>)/100>
IF !(<tag.HBSTR>==<LOCAL.HBSTR>)
MODSTR=<eval (<MODSTR> - (<TAG.HBSTR>-<local.hbstr>))>
TAG.HBSTR=<LOCAL.HBSTR>
ENDIF

//DEX
LOCAL.HBDEX = <eval (<ODEX>*<local.POH>)/100>
IF !(<tag.HBDEX>==<LOCAL.HBDEX>)
MODDEX=<eval (<MODDEX> - (<TAG.HBDEX>-<local.hbdex>))>
TAG.HBDEX=<LOCAL.HBDEX>
ENDIF

//INT
LOCAL.HBINT = <eval (<OINT>*<local.POH>)/100>
IF !(<tag.HBINT>==<LOCAL.HBINT>)
MODINT=<eval (<MODINT> - (<TAG.HBINT>-<local.hbint>))>
TAG.HBINT=<LOCAL.HBINT>
ENDIF
03-05-2015 04:00 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)