function script Builds { function Get_Menu; function Save_Build; function Load_Build; .@BuildCount = 12; // Number of builds to use .@Save = 5000; // Zeny required to save a build .@Load = 10000; // Zeny required to load a build .@Rename = 1000; // Zeny required to rename a build .@MaxLevel = 99; // Maximum base level (to prevent stat overflow) if (BaseLevel < .@MaxLevel) { mes strcharinfo(0),"You must be level "+.@MaxLevel+" to use this."; close2; end; } switch(select("Save Build...:Load Build...:Rename Build...:Close")) { case 1: if (.@Save) mes strcharinfo(0),"It costs "+.@Save+" Zeny to save a build."; .@Build = Get_Menu(.@BuildCount); if (Zeny<.@Save) { mes strcharinfo(0),"Not enough Zeny."; close; } if (getd("Build_"+.@Build+"$")!="") { mes strcharinfo(0),"Overwrite previous build #"+.@Build+"?"; if(select("Save new build:Cancel")==2) close; } Save_Build(.@Build); mes strcharinfo(0),"Type a name for your build."; input getd("Build_"+.@Build+"n$"); mes strcharinfo(0),"Build #"+.@Build+" ("+getd("Build_"+.@Build+"n$")+") saved."; Zeny -= .@Save; close; case 2: if (.@Load) mes strcharinfo(0),"It costs "+.@Load+" Zeny to load a build."; .@Build = Get_Menu(.@BuildCount); if (getd("Build_"+.@Build+"$")=="") { mes strcharinfo(0),"No build info found."; close; } if (Zeny<.@Load) { mes strcharinfo(0),"Not enough Zeny."; close; } Load_Build(getd("Build_"+.@Build+"$")); mes strcharinfo(0),"Build #"+.@Build+" loaded."; Zeny -= .@Load; close; case 3: if (.@Rename) mes strcharinfo(0),"It costs "+.@Rename+" Zeny to rename a build."; .@Build = Get_Menu(.@BuildCount); if (getd("Build_"+.@Build+"$")=="") { mes strcharinfo(0),"No build info found."; close; } if (Zeny<.@Rename) { mes strcharinfo(0),"Not enough Zeny."; close; } mes strcharinfo(0),"Type a new name for Build #"+.@Build+" ("+getd("Build_"+.@Build+"n$")+")."; input getd("Build_"+.@Build+"n$"); mes strcharinfo(0),"Build #"+.@Build+" renamed."; Zeny-=.@Rename; close; case 4: close; } function Get_Menu { .@menu$ = ""; for(.@i = 1; .@i<=getarg(0); .@i+=1) .@menu$ = .@menu$+"Slot "+.@i+" ("+((getd("Build_"+.@i+"n$")=="")?"^777777empty":"^0055FF"+getd("Build_"+.@i+"n$"))+"^000000):"; return select(.@menu$); } function Save_Build { .@s$ = ""; for(.@i = 13; .@i<19; .@i +=1 ) .@s$ = .@s$+readparam(.@i)+"|"; setd "Build_"+getarg(0)+"$", .@s$+StatusPoint; return; } function Load_Build { resetstatus; explode(.@s$,getarg(0),"|"); for( .@i = 0; .@i<6; .@i+=1) statusup2 (.@i+13), atoi(.@s$[.@i])-1; StatusPoint = atoi(.@s$[6]); return; } }