joelolopez Posted February 27, 2015 Group: Members Topic Count: 154 Topics Per Day: 0.03 Content Count: 493 Reputation: 46 Joined: 01/24/12 Last Seen: August 25, 2022 Share Posted February 27, 2015 (edited) masters i would like to request a npc that gives a different kind of potions depending on the character level. level 1~25 red potion level 26~50 orange potion level 51~75 yellow potion level 76 and up white potion but the tricky part is the amount of potions that will be given will vary on the maximum weight of the character the total weight of the potions should be exact 49% to avoid 50% weight penalty i hope sir capuche and other master scripters here would help me.. its not that im being lazy, infact i already have my own script but i cant make it work.. Edited February 27, 2015 by joelolopez Quote Link to comment Share on other sites More sharing options...
Capuche Posted February 27, 2015 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted February 27, 2015 or like prontera,150,150,1 script dfh 56,{ if (BaseLevel > 100) .@item_id = 504;// white potion else .@item_id = 501 + (BaseLevel -1) / 25; if ( ( getiteminfo(.@item_id,6) + Weight ) < ( MaxWeight/2 ) ) { .@amount = ( MaxWeight /2 - Weight ) / getiteminfo(.@item_id,6);// 50% maxweight - my weight / item weight if ( ( getiteminfo(.@item_id,6) * .@amount + Weight ) >= ( MaxWeight/2 ) )// weight at exactly 50% .@amount--; getitem .@item_id, .@amount; } end; } Stolao care about the lvl > 100 for 501 + Baselevel / 25 Quote Link to comment Share on other sites More sharing options...
Stolao Posted February 27, 2015 Group: Developer Topic Count: 48 Topics Per Day: 0.01 Content Count: 1443 Reputation: 344 Joined: 10/17/12 Last Seen: Sunday at 01:58 PM Share Posted February 27, 2015 (edited) map,x,y,f script Brew Master 123,{ mes "[Brew Master]"; mes "Would you like some potions?"; if(select("Yes:No")==2) close; while(MaxWeight * 49 /100 > Weight){ getitem,501 + Baselevel / 25,1; } close; } Edited February 27, 2015 by Stolao Quote Link to comment Share on other sites More sharing options...
joelolopez Posted February 27, 2015 Group: Members Topic Count: 154 Topics Per Day: 0.03 Content Count: 493 Reputation: 46 Joined: 01/24/12 Last Seen: August 25, 2022 Author Share Posted February 27, 2015 (edited) thanks for the both of you masters, but as i scan ur codes i didnt find any conditions for this level 1~25 red potion level 26~50 orange potion level 51~75 yellow potion level 76 and up white potio and the max weight of the total potions should < 50% so that the character wont get 50% overweight penalty icon but ill try your codes ryt away masters! =========================================================== sir can i request some follow up modification to ur script? can you divide the 49% weight into health potion and the other half is blue potion Edited February 27, 2015 by joelolopez Quote Link to comment Share on other sites More sharing options...
Capuche Posted February 27, 2015 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted February 27, 2015 prontera,150,150,1 script dfh 56,{ if (BaseLevel > 100) .@item_id = 504;// white potion else .@item_id = 501 + (BaseLevel -1) / 25; if ( ( 150 + Weight ) < ( MaxWeight/2 ) ) { .@weight_healt = getiteminfo(.@item_id,6); .@amount_healt = ( MaxWeight /2 - Weight ) / ( 2 *.@weight_healt ); .@amount_blue = ( MaxWeight /2 - Weight - .@weight_healt * .@amount_healt ) / 150; if ( ( .@weight_healt * .@amount_healt + .@amount_blue * 150 + Weight ) >= ( MaxWeight/2 ) ) .@amount_healt--; getitem .@item_id, .@amount_healt; getitem 505, .@amount_blue; } end; } the conditions level 1~25 red potion level 26~50 orange potion level 51~75 yellow potion level 76 and up white potion are in .@item_id = 501 + (BaseLevel -1) / 25; Quote Link to comment Share on other sites More sharing options...
joelolopez Posted February 27, 2015 Group: Members Topic Count: 154 Topics Per Day: 0.03 Content Count: 493 Reputation: 46 Joined: 01/24/12 Last Seen: August 25, 2022 Author Share Posted February 27, 2015 prontera,150,150,1 script dfh 56,{ if (BaseLevel > 100) .@item_id = 504;// white potion else .@item_id = 501 + (BaseLevel -1) / 25; if ( ( 150 + Weight ) < ( MaxWeight/2 ) ) { .@weight_healt = getiteminfo(.@item_id,6); .@amount_healt = ( MaxWeight /2 - Weight ) / ( 2 *.@weight_healt ); .@amount_blue = ( MaxWeight /2 - Weight - .@weight_healt * .@amount_healt ) / 150; if ( ( .@weight_healt * .@amount_healt + .@amount_blue * 150 + Weight ) >= ( MaxWeight/2 ) ) .@amount_healt--; getitem .@item_id, .@amount_healt; getitem 505, .@amount_blue; } end; } the conditions level 1~25 red potion level 26~50 orange potion level 51~75 yellow potion level 76 and up white potion are in .@item_id = 501 + (BaseLevel -1) / 25; sweetttttttt tnx sir capuche! another dream come true! 1 Quote Link to comment Share on other sites More sharing options...
Stolao Posted March 2, 2015 Group: Developer Topic Count: 48 Topics Per Day: 0.01 Content Count: 1443 Reputation: 344 Joined: 10/17/12 Last Seen: Sunday at 01:58 PM Share Posted March 2, 2015 or like prontera,150,150,1 script dfh 56,{ if (BaseLevel > 100) .@item_id = 504;// white potion else .@item_id = 501 + (BaseLevel -1) / 25; if ( ( getiteminfo(.@item_id,6) + Weight ) < ( MaxWeight/2 ) ) { .@amount = ( MaxWeight /2 - Weight ) / getiteminfo(.@item_id,6);// 50% maxweight - my weight / item weight if ( ( getiteminfo(.@item_id,6) * .@amount + Weight ) >= ( MaxWeight/2 ) )// weight at exactly 50% .@amount--; getitem .@item_id, .@amount; } end; } Stolao care about the lvl > 100 for 501 + Baselevel / 25 I assumed it was a 99 max server my bad. Quote Link to comment Share on other sites More sharing options...
Question
joelolopez
masters i would like to request a npc that
gives a different kind of potions depending on the character level.
level 1~25 red potion
level 26~50 orange potion
level 51~75 yellow potion
level 76 and up white potion
but the tricky part is
the amount of potions that will be given
will vary on the maximum weight of the character
the total weight of the potions should be exact 49%
to avoid 50% weight penalty
i hope sir capuche and other master scripters here would help me..
its not that im being lazy, infact i already have my own script but
i cant make it work..
Edited by joelolopezLink to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.