Here's one part of the script that i made, i was thinking of methods of shortening this, would there be anyway? as the 2nd part of the case is all duplicated except for the item IDs.
I'm not really good with arrays, so if someone could provide me an example, I'd be really grateful!
if(baselevel >= 5 && novice_ground == 1) { mes ""+.npc_name$+""; mes "Good job Leveling up! Go on! Take one item from my stash! It's on me!"; next; switch(select("Cutter:Falchion:Mace:Main Gauche")){ case 1: mes ""+.npc_name$+""; mes "You've selected ^FF0000Cutter^000000."; mes "Are you sure?"; next; switch(select("Yes:No")){ case 1: mes ""+.npc_name$+""; mes "Here you go!"; getitem 13040,1; set novice_ground, 2; close; case 2: mes ""+.npc_name$+""; mes "Come back once you've decided!"; close; } case 2: mes ""+.npc_name$+""; mes "You've selected ^FF0000Falchion^000000."; mes "Are you sure?"; next; switch(select("Yes:No")){ case 1: mes ""+.npc_name$+""; mes "Here you go!"; getitem 13415,1; set novice_ground, 2; close; case 2: mes ""+.npc_name$+""; mes "Come back once you've decided!"; close; } case 3: mes ""+.npc_name$+""; mes "You've selected ^FF0000Mace^000000."; mes "Are you sure?"; next; switch(select("Yes:No")){ case 1: mes ""+.npc_name$+""; mes "Here you go!"; getitem 1545,1; set novice_ground, 2; close; case 2: mes ""+.npc_name$+""; mes "Come back once you've decided!"; close; } case 4: mes ""+.npc_name$+""; mes "You've selected ^FF0000Main Gauche^000000."; mes "Are you sure?"; next; switch(select("Yes:No")){ case 1: mes ""+.npc_name$+""; mes "Here you go!"; getitem 13041,1; set novice_ground, 2; close; case 2: mes ""+.npc_name$+""; mes "Come back once you've decided!"; close; } } }
Hi Guys,
Here's one part of the script that i made, i was thinking of methods of shortening this, would there be anyway? as the 2nd part of the case is all duplicated except for the item IDs.
I'm not really good with arrays, so if someone could provide me an example, I'd be really grateful!
Share this post
Link to post
Share on other sites