Jump to content
  • 0

Super Novice Link


Eross

Question


  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.11
  • Content Count:  349
  • Reputation:   12
  • Joined:  04/05/20
  • Last Seen:  

Hi ! Can you teach me how to make this 10% chance ? Because on this topic they made it 100% .. I dont know how to make it 10% only 

SUPER NOVICE SPIRIT SKILL

- Super Novices above LV 90 have 1% chance to 'erase' the death record - which means, the last 1% EXP loss will be recovered.

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.01
  • Content Count:  68
  • Reputation:   7
  • Joined:  02/21/19
  • Last Seen:  

Go to the same line and simply remove a 0 from the 100 after rnd()%

it should look like this:

		if (skill_id == SL_SUPERNOVICE && dstsd && dstsd->die_counter && !(rnd()%10))
		{	//Erase death count 1% of the casts
			pc_setparam(dstsd, SP_PCDIECOUNTER, 0);
			clif_specialeffect(bl, EF_ANGEL2, AREA);
			//SC_SPIRIT invokes status_calc_pc for us.
		}

 

Edited by TheKingDino
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.11
  • Content Count:  349
  • Reputation:   12
  • Joined:  04/05/20
  • Last Seen:  

1 minute ago, TheKingDino said:

Go to the same line and simply remove a 0 from the 100 after rnd()%

it should look like this:

		if (skill_id == SL_SUPERNOVICE && dstsd && dstsd->die_counter && !(rnd()%10))
		{	//Erase death count 1% of the casts
			pc_setparam(dstsd, SP_PCDIECOUNTER, 0);
			clif_specialeffect(bl, EF_ANGEL2, AREA);
			//SC_SPIRIT invokes status_calc_pc for us.
		}

 

Thanks ! I will try this

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.01
  • Content Count:  68
  • Reputation:   7
  • Joined:  02/21/19
  • Last Seen:  

If I understand this correctly: The idea is the random number is divisible by 100, aka a 1 in 100 chance. So a 10 would make in a 1 in 10 chance.

Because ! means "NOT" and && means "and" when it's checking.

% is the modulus operator


Someone smarter can correct me if I'm wrong! I'm p sure that's the idea though.

Edited by TheKingDino
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...