Hi guys
I'm really bad with scripts
So I made the logic of an npc and I'm looking for help to finish.
If anyone knows.
It is a npc that checks if the player has some fruit.
Then, through a Menu, shows the fruits that the player has.
Then, the player selects the fruit he wants to change.
There are 3 levels of food.
(There are a lot of things wrong there, because like I said, it's just logic.)
//Legenda://// == fruits ID://// apple:40010// banana:40011// abobora:40012//// == fruit candy ID://// apple candy:40020// banana candy:40021// pumpkin candy:40022//// = fruit food ID//// apple food:40030// banana food:40031// pumpkin food:40032//I intend to add several fruitsswitch( select ("Level 1","Level 2","Level 3","Cancelar.")){case1:
setarray @fruits[0],40010,40011,40012;for(@i=0,@i<@fruits[0],@i++){//to go through the arrayif(countitem(@fruits[@i])//add the fruit ID's that the player has in some variable?//need to store the fruits found in a new array?}
callsub MakeFood;break;case2:
setarray @fruits[0],40020,40021,40022;for(@i=0,@i<@fruits[0],@i++){//to go through the arrayif(countitem(@fruits[@i])//add the fruit ID's that the player has in some variable?//need to store the fruits found in a new array?}
callsub MakeFood;break;case3:
setarray @fruits[0],40030,40031,40032;for(@i=0,@i<@fruits[0],@i++){//to go through the arrayif(countitem(@fruits[@i])//add the fruit ID's that the player has in some variable?//need to store the fruits found in a new array?}
callsub MakeFood;break;}MakeFood:if(fruits in inventary <=1){//found no fruit (or more than 1.)
mes .NpcName$;
mes "Oh... sorry...";
mes "When you have two or more fruits equals";
mes "come back here.";
close;}
mes .NpcName$;
mes "These are your fruits.;
mes "Which would you like to do";
menu("@item_name+ @quantity, @item_name+ @quantity, @item_name+ @quantitye");//menu with the fruits found in the player//will you need a FOR to make this menu?
mes "You chose the "+@item_name+", we can continue?";if(select("Yes, we can!:No...better not...")==2){
mes .NpcName$;
mes "Ok, bye.";
close;}if(checkweight is 90%){//check if the luggage is overweight
mes .NpcName$;
mes "You're carrying a lot of weight..";
mes "sorry.";
close;}
del item:@item_id_old,2;//delete two fruits oldset item:@item_id_new;//new food deliveryreturn;
Hi guys
I'm really bad with scripts
So I made the logic of an npc and I'm looking for help to finish.
If anyone knows.
It is a npc that checks if the player has some fruit.
Then, through a Menu, shows the fruits that the player has.
Then, the player selects the fruit he wants to change.
There are 3 levels of food.
(There are a lot of things wrong there, because like I said, it's just logic.)
Share this post
Link to post
Share on other sites