johnlol

Build Manager v1.8

May 3rd, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //===== rAthena Script =======================================
  2. //= Build Manager +
  3. //===== By: ==================================================
  4. //= Euphy
  5. //===== Current Version: =====================================
  6. //= 1.8
  7. //===== Description: =========================================
  8. //= Stores stat builds into a single character variable.
  9. //============================================================
  10.  
  11. sec_in02.gat,179,168,2  script  Build Manager   930,{
  12. function Get_Menu; function Save_Build; function Load_Build;
  13.  
  14.     set .@BuildCount,6; // Number of builds to use
  15.     set .@Save,50000;   // Zeny required to save a build
  16.     set .@Load,100000;  // Zeny required to load a build
  17.     set .@Rename,500000;    // Zeny required to rename a build
  18.     set .@MaxLevel,99;  // Maximum base level (to prevent stat overflow)
  19.  
  20.     if (BaseLevel < .@MaxLevel) { message strcharinfo(0),"You must be level "+.@MaxLevel+" to use this."; end; }
  21.     switch(select("Save Build...:Load Build...:Rename Build...:Close")) {
  22.         case 1:
  23.             if (.@Save) message strcharinfo(0),"It costs "+.@Save+" Zeny to save a build.";
  24.             set .@Build, Get_Menu(.@BuildCount);
  25.             if (Zeny<.@Save) { message strcharinfo(0),"Not enough Zeny."; close; }
  26.             if (getd("Build_"+.@Build+"$")!="") {
  27.                 message strcharinfo(0),"Overwrite previous build #"+.@Build+"?";
  28.                 if(select("Save new build:Cancel")==2) close; }
  29.             Save_Build(.@Build);
  30.             message strcharinfo(0),"Type a name for your build.";
  31.             input getd("Build_"+.@Build+"n$");
  32.             message strcharinfo(0),"Build #"+.@Build+" ("+getd("Build_"+.@Build+"n$")+") saved.";
  33.             set Zeny, Zeny-.@Save;
  34.             close;
  35.         case 2:
  36.             if (.@Load) message strcharinfo(0),"It costs "+.@Load+" Zeny to load a build.";
  37.             set .@Build, Get_Menu(.@BuildCount);
  38.             if (getd("Build_"+.@Build+"$")=="") {
  39.                 message strcharinfo(0),"No build info found."; close; }
  40.             if (Zeny<.@Load) { message strcharinfo(0),"Not enough Zeny."; close; }
  41.             Load_Build(getd("Build_"+.@Build+"$"));
  42.             message strcharinfo(0),"Build #"+.@Build+" loaded.";
  43.             set Zeny, Zeny-.@Load;
  44.             close;
  45.         case 3:
  46.             if (.@Rename) message strcharinfo(0),"It costs "+.@Rename+" Zeny to rename a build.";
  47.             set .@Build, Get_Menu(.@BuildCount);
  48.             if (getd("Build_"+.@Build+"$")=="") {
  49.                 message strcharinfo(0),"No build info found."; close; }
  50.             if (Zeny<.@Rename) { message strcharinfo(0),"Not enough Zeny."; close; }
  51.             message strcharinfo(0),"Type a new name for Build #"+.@Build+" ("+getd("Build_"+.@Build+"n$")+").";
  52.             input getd("Build_"+.@Build+"n$");
  53.             message strcharinfo(0),"Build #"+.@Build+" renamed.";
  54.             set Zeny, Zeny-.@Rename;
  55.             close;
  56.         case 4:
  57.             close; }
  58.     function Get_Menu {
  59.         set .@menu$,"";
  60.         for(set .@i,1; .@i<=getarg(0); set .@i,.@i+1)
  61.             set .@menu$, .@menu$+"Slot "+.@i+" ("+((getd("Build_"+.@i+"n$")=="")?"^777777empty":"^0055FF"+getd("Build_"+.@i+"n$"))+"^000000):";
  62.         return select(.@menu$); }
  63.     function Save_Build {
  64.         set .@s$,"";
  65.         for(set .@i,13; .@i<19; set .@i,.@i+1)
  66.             set .@s$,.@s$+readparam(.@i)+"|";
  67.         setd "Build_"+getarg(0)+"$", .@s$+StatusPoint;
  68.         return; }
  69.     function Load_Build {
  70.         ResetStatus;
  71.         explode(.@s$,getarg(0),"|");
  72.         for(set .@i,0; .@i<6; set .@i,.@i+1)
  73.             statusup2 (.@i+13), atoi(.@s$[.@i])-1;
  74.         set StatusPoint, atoi(.@s$[6]);
  75.         return; }
  76. }
Add Comment
Please, Sign In to add comment