Jump to content
  • 0

Block skill based on HP


yukkimi0100

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  12/02/18
  • Last Seen:  

How do I block a skill from being used only if the user's life is < or = a X%?
I tried to do it via onPcUseSkillEvent however this means that even if the skill is blocked, it goes on cooldown

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  897
  • Reputation:   248
  • Joined:  01/30/13
  • Last Seen:  

Look at how Magnum Break is done.

    Requires:
      HpCost:
        - Level: 1
          Amount: 20
        - Level: 2
          Amount: 20
        - Level: 3
          Amount: 19
        - Level: 4
          Amount: 19
        - Level: 5
          Amount: 18
        - Level: 6
          Amount: 18
        - Level: 7
          Amount: 17
        - Level: 8
          Amount: 17
        - Level: 9
          Amount: 16
        - Level: 10
          Amount: 16
      SpCost: 30

First you define a HP cost. You can also use "HpRateCost" for percentual cost.

Then you want to make sure the HP is only required but not consumed.

For this go to skill.cpp and find "void skill_consume_hpspap".

	switch (skill_id) {
		//Skills that require HP but do not consume them
	case SM_MAGNUM:
	case MS_MAGNUM:
		hp = 0;
		break;
	

Now you just need to add your skill here, so it doesn't consume the HP that it requires.

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