Jump to content
  • 0

Item bonus with current HP condition


Roku

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   0
  • Joined:  02/17/13
  • Last Seen:  

Hello, I am trying to figure out if it's possible to make an item grant a bonus depending on current HP. I would like an armor item to grant 20% damage to all classes when the character is below 50%. 

 

I tried if(Hp < MaxHp / 100 * 50) { ... } but it did not work. Is this kind of condition even possible or would it require the player to equip the item when below 50%?

Edited by Roku
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   0
  • Joined:  02/17/13
  • Last Seen:  

 if(Hp < MaxHp / 100 * 50) { ... } is working, my bad. It just takes a few seconds when the char has crossed the threshold for the client to realize.

 

Can be closed.

Edited by Roku
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

if(MaxHp <= 50){

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...