Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing Life Mana Stam Regen *solved*
Author Message
AmpereJoule
Journeyman
*

Posts: 59
Likes Given: 7
Likes Received: 0 in 0 posts
Joined: Dec 2012
Reputation: 0



Post: #1
Changing Life Mana Stam Regen *solved*
Hello,


I would like to change the life regen formula to:
" Life_regen_value = str/100 " (min = 1)
" Life_regen_time = 20 - healing/5 " (max = 1)

I know that in sphere.ini there is:
Code:
// Time in seconds for hitpoint regeneration
Regen0=20

So, how can I change it like the formula I said above?


Thank you.
(This post was last modified: 05-06-2015 11:10 PM by AmpereJoule.)
09-13-2013 06:34 AM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #2
RE: Changing Life Regen
You can override the healing rate of an individual by putting TAG(s) on the player:

TAG.OVERRIDE.REGEN_0 //Is the "rate" of hitpoint regeneration (default is defined by Regen0 in the Sphere.ini)
TAG.OVERRIDE.REGENVAL_0 //Is the "amount" of hitpoint regeneration (default=1)

To set the TAGs, you need a event on all the players and mosters that calls the @SkillChange trigger (to capture changes in Healing) and the @StatChange (to detect changes in STR.)
09-13-2013 06:55 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes RanXerox's post
AmpereJoule
Journeyman
*

Posts: 59
Likes Given: 7
Likes Received: 0 in 0 posts
Joined: Dec 2012
Reputation: 0



Post: #3
RE: Changing Life Regen
I have a script that is a Stone which the player has to choose:
Warrior <button here>
Archer <button here>
Mage <button here>

these are some lines of it:
Code:
[DIALOG D_classes BUTTON]
ON=0 5
IF !(<ARGN>)
src.skillclass=Class_guerreiro
GO britain
ELIF (<ARGN>==1)
src.skillclass=Class_arqueiro
GO britain
ELIF (<ARGN>==2)
src.skillclass=Class_mago
GO britain
ENDIF

Can I put the TAGs here?


and how can I get the ARGN? (I only know programming C and VBA, and there i would create a variable inside of a function)

Here it looks like:
Code:
@SkillChange
     ARGN1 = "number of healing" //chosing healing
     TAG.OVERRIDE.REGEN_0 = 20 - ARGN2/5 //ARG2 is the new value of healing
     IF ( TAG.OVERRIDE.REGEN_0 <= 0 )
          TAG.OVERRIDE.REGEN_0 = 1 //one second to regenerate
     ENDIF
End @SkillChange (?)

@StatChange
     ARGN1 = 0 //chosing str
     TAG.OVERRIDE.REGENVAL_0 = ARGN2/100 //when the str of the players gets 200, he will recover 2 health points instead of 1
     IF ( TAG.OVERRIDE.REGENVAL_0 < 1 )
          TAG.OVERRIDE.REGENVAL_0 = 1 //default = 1
     ENDIF
End @StatChange (?)

PS: I learn that from: http://wiki.sphere.torfo.org/index.php/@SkillChange and http://wiki.sphere.torfo.org/index.php/@StatChange


PS 2: Is TAG.OVERRIDE.REGEN_1 and TAG.OVERRIDE.REGENVAL_1 the time and value of Stam Regen?
Is TAG.OVERRIDE.REGEN_2 and TAG.OVERRIDE.REGENVAL_2 the time and value of Mana Regen?
(This post was last modified: 09-13-2013 10:46 AM by AmpereJoule.)
09-13-2013 10:04 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,140
Likes Given: 217
Likes Received: 89 in 76 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #4
RE: Changing Life Regen
PHP Code:
[EVENTS E_REGEN]
ON=@SKILLCHANGE
TAG
.OVERRIDE.REGEN_0 100
TAG
.OVERRIDE.REGENVAL_0 <EVAL (<STR>/100) + (<HEALING>/50)>
ON=@STATCHANGE
TAG
.OVERRIDE.REGEN_0 100
TAG
.OVERRIDE.REGENVAL_0 <EVAL (<STR>/100) + (<HEALING>/50)> 
Mana: TAG.OVERRIDE.REGEN_1 and TAG.OVERRIDE.REGENVAL_1
Stam: TAG.OVERRIDE.REGEN_2 and TAG.OVERRIDE.REGENVAL_2

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.
(This post was last modified: 09-13-2013 12:49 PM by Extreme.)
09-13-2013 12:41 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Extreme's post
AmpereJoule
Journeyman
*

Posts: 59
Likes Given: 7
Likes Received: 0 in 0 posts
Joined: Dec 2012
Reputation: 0



Post: #5
RE: Changing Life Regen
(09-13-2013 12:41 PM)Extreme Wrote:  
PHP Code:
[EVENTS E_REGEN]
ON=@SKILLCHANGE
TAG
.OVERRIDE.REGEN_0 100
TAG
.OVERRIDE.REGENVAL_0 <EVAL (<STR>/100) + (<HEALING>/50)>
ON=@STATCHANGE
TAG
.OVERRIDE.REGEN_0 100
TAG
.OVERRIDE.REGENVAL_0 <EVAL (<STR>/100) + (<HEALING>/50)> 
Mana: TAG.OVERRIDE.REGEN_1 and TAG.OVERRIDE.REGENVAL_1
Stam: TAG.OVERRIDE.REGEN_2 and TAG.OVERRIDE.REGENVAL_2

it is only changing the value, right?

The time between the heals is "100" seconds, right?

To activate it only for players,
Code:
//Events related to all players
EventsPlayer=E_REGEN
should I put on "sphere.ini" like this?

PHP Code:
[EVENTS E_REGEN]
ON=@SKILLCHANGE
     TAG
.OVERRIDE.REGEN_0 <EVAL (20) - (<HEALING>/5)> 
     IF (
TAG.OVERRIDE.REGEN_0 <= 0)
          
TAG.OVERRIDE.REGEN_0 1
     
ENDIF
     
TAG.OVERRIDE.REGENVAL_0 <EVAL (<STR>/100) >
     IF ( 
TAG.OVERRIDE.REGENVAL_0 )
          
TAG.OVERRIDE.REGENVAL_0 //default = 1
     
ENDIF 
ON=@STATCHANGE
     TAG
.OVERRIDE.REGEN_0 <EVAL (20 - (<HEALING>/5)>
     IF (
TAG.OVERRIDE.REGEN_0 <= 0)
          
TAG.OVERRIDE.REGEN_0 1
     
ENDIF 
     
TAG.OVERRIDE.REGENVAL_0 <EVAL (<STR>/100)> 
     IF ( 
TAG.OVERRIDE.REGENVAL_0 )
          
TAG.OVERRIDE.REGENVAL_0 //default = 1
     
ENDIF 

Is it Right?
(This post was last modified: 09-13-2013 01:15 PM by AmpereJoule.)
09-13-2013 01:07 PM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,140
Likes Given: 217
Likes Received: 89 in 76 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #6
RE: Changing Life Regen
(09-13-2013 01:07 PM)AmpereJoule Wrote:  it is only changing the value, right?

The time between the heals is "100" seconds, right?
No, if you use '1' on tag, it will wait few seconds.. I don't know why, but using 100 will regen in every 1 second as you want.

To activate it only for players,
Code:
//Events related to all players
EventsPlayer=E_REGEN
should I put on "sphere.ini" like this?
Yes.

Is it Right?
You should use that I wrote...

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.
09-13-2013 01:24 PM
Find all posts by this user Like Post Quote this message in a reply
AmpereJoule
Journeyman
*

Posts: 59
Likes Given: 7
Likes Received: 0 in 0 posts
Joined: Dec 2012
Reputation: 0



Post: #7
RE: Changing Life Regen
(09-13-2013 01:24 PM)Extreme Wrote:  
(09-13-2013 01:07 PM)AmpereJoule Wrote:  it is only changing the value, right?

The time between the heals is "100" seconds, right?
No, if you use '1' on tag, it will wait few seconds.. I don't know why, but using 100 will regen in every 1 second as you want.

To activate it only for players,
Code:
//Events related to all players
EventsPlayer=E_REGEN
should I put on "sphere.ini" like this?
Yes.

Is it Right?
You should use that I wrote...

I do not want to regen in 1 second.
I want that it regenerates on 20 seconds - (healing of the player)/5, and then when the player gets healing 100.0 it will be 1 second
I also want that the value that regenerates is 1 and then it grows as the str grows.

and in your code it looks like it will always be 1 second to regen, and the healing will affect the value that will regenerate.


(But thank you, you opened my mind \o\)
(This post was last modified: 09-13-2013 01:39 PM by AmpereJoule.)
09-13-2013 01:33 PM
Find all posts by this user Like Post Quote this message in a reply
AmpereJoule
Journeyman
*

Posts: 59
Likes Given: 7
Likes Received: 0 in 0 posts
Joined: Dec 2012
Reputation: 0



Post: #8
RE: Changing Life Regen
Hello?

Is my code right?

I do not know how to use "IF" here, please someone help!
09-14-2013 04:41 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,140
Likes Given: 217
Likes Received: 89 in 76 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #9
RE: Changing Life Regen
Ahh, now I understand you...
You wrote this:
Code:
I would like to change the life regen formula to:
" Life_regen = str/100 + healing/50 " (per second)
So I understood you wanted to regen str/100 + healing/50 on every second...

Well, the TAG.OVERRIDE.REGEN_0 is not in seconds and I don't know how it works... I just know that setting to 1 it will not work on every second, and setting 100 you will get on every second.

Then I don't know how to do what you want.
You will need test again and again until you get what you need.

PHP Code:
[EVENTS E_REGEN]
ON=@SKILLCHANGE
     TAG
.OVERRIDE.REGEN_0 <MAX 1,<EVAL 20-(<HEALING>/5)>>
     
TAG.OVERRIDE.REGENVAL_0 <MAX 1,<EVAL <STR>/100>>
ON=@STATCHANGE
     TAG
.OVERRIDE.REGEN_0 <MAX 1,<EVAL 20-(<HEALING>/5)>>
     
TAG.OVERRIDE.REGENVAL_0 <MAX 1,<EVAL <STR>/100>>

[FUNCTION 
MAX]
IF <
ARGV[0]> >= <ARGV[1]>
 RETURN <
ARGV[0]>
ENDIF
RETURN <
ARGV[1]> 

It will work as you want... just check the regen_0 timer thing... do tests!!!!!!!!!!

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.
09-14-2013 04:54 AM
Find all posts by this user Like Post Quote this message in a reply
AmpereJoule
Journeyman
*

Posts: 59
Likes Given: 7
Likes Received: 0 in 0 posts
Joined: Dec 2012
Reputation: 0



Post: #10
RE: Changing Life Regen
(09-14-2013 04:54 AM)Extreme Wrote:  Ahh, now I understand you...
You wrote this:
Code:
I would like to change the life regen formula to:
" Life_regen = str/100 + healing/50 " (per second)
So I understood you wanted to regen str/100 + healing/50 on every second...

Well, the TAG.OVERRIDE.REGEN_0 is not in seconds and I don't know how it works... I just know that setting to 1 it will not work on every second, and setting 100 you will get on every second.

Then I don't know how to do what you want.
You will need test again and again until you get what you need.

PHP Code:
[EVENTS E_REGEN]
ON=@SKILLCHANGE
     TAG
.OVERRIDE.REGEN_0 <MAX 1,<EVAL 20-(<HEALING>/5)>>
     
TAG.OVERRIDE.REGENVAL_0 <MAX 1,<EVAL <STR>/100>>
ON=@STATCHANGE
     TAG
.OVERRIDE.REGEN_0 <MAX 1,<EVAL 20-(<HEALING>/5)>>
     
TAG.OVERRIDE.REGENVAL_0 <MAX 1,<EVAL <STR>/100>>

[FUNCTION 
MAX]
IF <
ARGV[0]> >= <ARGV[1]>
 RETURN <
ARGV[0]>
ENDIF
RETURN <
ARGV[1]> 

It will work as you want... just check the regen_0 timer thing... do tests!!!!!!!!!!

nice! But I want that 1 to be the min of REGENVAL_0, and the MAX i want to be str/100

About REGEN_0 I want that it initiates at 20 seconds and the max must be 1 second, but i want that it changes as the healing changes ( 20 - healing/5 ).

Can you explain your code to me? (every single simbol, like "<" and "(" please?)


pleeeease?
(This post was last modified: 09-14-2013 08:08 AM by AmpereJoule.)
09-14-2013 05:58 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)