Jump to content
  • 0

Enchant Armor NPC


PapaZola

Question


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  925
  • Reputation:   32
  • Joined:  12/05/11
  • Last Seen:  

i already edit the percent to 100%

        

Quote

case 1:
            setarray .@Items[0],2371,2307,2309,2314,2316,2321,2325,2327,2328,2330,2332,2334,2335,2341,2344,2346,2348,2350,2337,2386;
            set .@j,100;
            break;
        case 2:
            setarray .@Items[0],2311,2318,2319,2320,2308,2310,2315,2317,2322,2324,2326,2331,2333,2336,2342,2345,2347,2349,2351;
            set .@j,100;
            set .@k,1;
            break;
        case 3:
            setarray .@Items[0],2357,2364,2365,2391,2374,2375,2387,2388,2389,2390;
            set .@j,100;
            break;

but when trying always failed and broke the armor

here my script

https://pastebin.com/J9NP53z8

Edited by PapaZola
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Looks like you didn't understand how the chance will be calculated in that script:
 

Line 71:
set .@failrate,getarg(1);

Line 100:
switch (rand(1,.@failrate)) {

getarg(1) = .@j
 

So in your example:
rand(1,100) > random value between 1 and 100
if you wanna get 100%, what do you need to put as value in .@j?
 

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