Jump to content

kalabasa

Members
  • Posts

    478
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by kalabasa

  1. So as the title says

    im getting error with these lines

    but when i initiate @reloadscript it works just fine

    if (!Class_Mastery) { message strcharinfo(0),"The book does not respond."; end; }
    
    if (!(Class_Mastery & pow(2,.@i)))

    and the full script im talking about.

    Spoiler
    prontera,148,203,4    script    Class Mastery::CMSys    405,{
    
        set .@n$,"[Class Mastery]";
        mes .@n$;
        mes "How may I assist you?";
        next;
        switch(select(" ~ Purchase a manual: ~ Purchase classes: ~ ^777777Close^000000")) {
            case 1:
                mes .@n$;
                if (!.Mode[3]) {
                    mes "It seems like we're out of stock";
                    mes "at the moment. My apologies.";
                    close; }
                if (countitem(.ManualID)) {
                    mes "We only allow one manual per character. Orders, orders...";
                    close; }
                mes "Manuals cost ^FF0000"+.Mode[3]+" Zeny^000000.";
                mes "Would you like one?";
                next;
                switch(select(" ~ Sure!: ~ I'll think about it.")) {
                    case 1:
                        mes .@n$;
                        if (Zeny < .Mode[3]) {
                            mes "You don't appear to have";
                            mes "enough Zeny... These are very";
                            mes "valuable books, you know?";
                            close; }
                        set Zeny, Zeny-.Mode[3];
                        getitem .ManualID,1;
                        specialeffect2 441;
                        mes "Enjoy!";
                        close;
                    case 2:
                        mes .@n$;
                        mes "Okay. Take your time.";
                        close; }
            case 2:
                mes .@n$;
                if (!.Mode[4]) {
                    mes "No classes are available for";
                    mes "purchase. You'll have to earn";
                    mes "them manually, I suppose...";
                    close; }
                if (!countitem(.ManualID)) {
                    mes "You'll need a manual first!";
                    close; }
                mes "Entries cost ^FF0000"+.Mode[4]+" Zeny^000000 each.";
                if (Zeny < .Mode[4]) {
                    mes "Go earn some more!";
                    close; }
                set .@menu$,"";
                for(set .@i,1; .@i<getarraysize(.JobList); set .@i,.@i+1) {
                    if (!(Class_Mastery & pow(2,.@i)))
                        set .@menu$, .@menu$+" ~ "+jobname(.JobList[.@i]);
                    set .@menu$, .@menu$+":"; }
                set .@menu$, .@menu$+" ~ ^777777Cancel^000000";
                next;
                set .@i, select(.@menu$);
                if (.@i == getarraysize(.JobList)) close;
                mes .@n$;
                mes "Are you sure you want to purchase an entry for the ^0055FF"+jobname(.JobList[.@i])+" ^000000class?";
                next;
                if(select(" ~ I'm sure.: ~ No, wait...") == 2) {
                    mes .@n$;
                    mes "That's perfectly fine.";
                    mes "Come back whenever you'd like.";
                    close; }
                mes .@n$;
                set Zeny, Zeny-.Mode[4];
                set Class_Mastery, Class_Mastery | pow(2,.@i);
                specialeffect2 441;
                mes "There you go, all done!";
                message strcharinfo(0),jobname(.JobList[.@i])+" added to Class Manual.";
                close;
            case 3:
                close; }
    
    OnPCJobLvUpEvent:
        if (!.Mode[1]) end;
        if (@JNull$ == jobname(Class)) end;
        else set @JNull$,"";
        if (!@JIndex || .JobList[@JIndex] != Class) {
            set @JIndex,0;
            for(set .@i,1; .@i<=getarraysize(.JobList); set .@i,.@i+1)
                if (Class == .JobList[.@i]) { set @JIndex, .@i; break; }
            if (!@JIndex) { set @JNull$, jobname(Class); end; } }
        if ((JobLevel == .JLvlMax[@JIndex]) && !(Class_Mastery & pow(2,@JIndex))) {
            set Class_Mastery, Class_Mastery | pow(2,@JIndex);
            atcommand "@allskill";
            message strcharinfo(0),jobname(Class)+" added to Class Manual.";
            for(set .@i,0; .@i<4; set .@i, .@i+1) {
                specialeffect2 441; sleep2 50; }
        } end;
    
    OnPCLoginEvent:
        if (.Mode[0] && !countitem(.ManualID)) getitem .ManualID,1;
        end;
    
    OnTimer50:
        stopnpctimer;
        setnpctimer 0;
        close;
    
    OnInit:
    // --------------------- Config ---------------------
    // Mode:
    //    [0] Manual received automatically upon login? (1: yes / 0: no)
    //    [1] Classes added automatically through leveling up? (1: yes / 0: no)
    //    [2] Enable NPC to purchase manual/classes? (1: yes / 0: no)
    //    [3] Price of manual, in Zeny (if NPC enabled; 0 to disable)
    //    [4] Price per class, in Zeny (if NPC enabled; 0 to disable)
        setarray .Mode[0],0,1,1,10000000,5000000;
    
    // JobList: All the classes (ID) that are available.
    // JLvlMax: The max job level of classes in JobList.
        setarray .JobList[1],0, 4008,4009,4010,4011,4012,4013,4015,4016,4017,4018,4019,4020,4021,23,24,25,4046,4047,4049;
        setarray .JLvlMax[1],10,  70,  70,  70,  70,  70,  70,  70,  70,  70,  70,  70,  70,  70,99,70,70,  50,  50,  50;
    
        set .ManualID,3333;    // Item ID of manual
        set .CastTime,4;    // Seconds for class change
        set .Interrupt,1;    // Class change is interruptable? (1: yes / 0: no)
        set .BuildCount,4;    // Number of builds and Quick Change options (max 26)
        set .MaxLevel,99;    // Maximum base level (to prevent stat overflow)
    
    // --------------------------------------------------
        if (!.Mode[2]) hideonnpc "CMSys";
        end;
    }
    
    function    script    Class_Mastery    {
    function Class_Change; function Get_Menu; function Save_Build; function Load_Build;
    
        if (!Class_Mastery) { message strcharinfo(0),"The book does not respond."; end; }
        while(1) {
            message strcharinfo(0)," ~ Class Mastery System ~ ";
            switch(select(" > Quick Change: > Set Quick Change Options: > Switch Classes: > Manage Builds: > ^777777Close^000000")) {
                case 1:
                    message strcharinfo(0),"Quick Change:";
                    set .@index, Get_Menu(1,getvariableofnpc(.BuildCount,"CMSys"));
                    if (.@index == getvariableofnpc(.BuildCount,"CMSys")+1) break;
                    if (!@QC1[.@index] && (!@QC2[.@index] || BaseLevel < getvariableofnpc(.MaxLevel,"CMSys"))) {
                        message strcharinfo(0),"Class change failed."; close; }
                    if (@QC1[.@index]) Class_Change(@QC1[.@index]);
                    if (@QC2[.@index]) { 
                        if (BaseLevel < getvariableofnpc(.MaxLevel,"CMSys")) message strcharinfo(0),"Level requirement not met for build change.";
                        else Load_Build(getd("Build_"+@QC2[.@index]+"$")); }
                    close;
                case 2:
                    setarray .@ar$[0],"*","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z";
                    while(1) {
                        message strcharinfo(0),"Set Quick Change Options:";
                        set .@index, Get_Menu(1,getvariableofnpc(.BuildCount,"CMSys"));
                        if (.@index == getvariableofnpc(.BuildCount,"CMSys")+1) break;
                        message strcharinfo(0),"Set Quick Change Options > Slot "+.@index+":";
                        switch(select(" > Edit job ("+((@QC1[.@index])?"^0055FF"+jobname(getvariableofnpc(.JobList[@QC1[.@index]],"CMSys")):"^777777none")+"^000000): > Edit build ("+((@QC2[.@index])?"^0055FF"+@QC2[.@index]:"^777777none")+"^000000): > ^777777Back^000000")) {
                            case 1:
                                message strcharinfo(0),"Set Quick Change Options > Slot "+.@index+" > Edit job:";
                                set .@i, Get_Menu(2,getarraysize(getvariableofnpc(.JobList,"CMSys")));
                                if (.@i == getarraysize(getvariableofnpc(.JobList,"CMSys"))) break;
                                set @QC1[.@index], .@i;
                                set QC1$,"_";
                                for(set .@i,1; .@i<=getvariableofnpc(.BuildCount,"CMSys"); set .@i,.@i+1)
                                    set QC1$, QC1$+.@ar$[@QC1[.@i]];
                                message strcharinfo(0),"Changes saved.";
                                sleep2 250; break;
                            case 2:
                                message strcharinfo(0),"Set Quick Change Options > Slot "+.@index+" > Edit build:";
                                if (BaseLevel < getvariableofnpc(.MaxLevel,"CMSys")) {
                                    message strcharinfo(0),"You must be level "+getvariableofnpc(.MaxLevel,"CMSys")+" to use this."; sleep2 250; break; }
                                set .@build, Get_Menu(3,getvariableofnpc(.BuildCount,"CMSys"),1);
                                if (.@build == getvariableofnpc(.BuildCount,"CMSys")+2) break;
                                if (getd("Build_"+.@build+"$")=="" && .@build != getvariableofnpc(.BuildCount,"CMSys")+1) {
                                    message strcharinfo(0),"No build info found."; sleep2 250; break; }
                                else set @QC2[.@index], (((.@build == getvariableofnpc(.BuildCount,"CMSys")+1))?0:.@build);
                                set QC2$,"_";
                                for(set .@i,1; .@i<=getvariableofnpc(.BuildCount,"CMSys"); set .@i,.@i+1)
                                    set QC2$, QC2$+.@ar$[@QC2[.@i]];
                                message strcharinfo(0),"Changes saved.";
                                sleep2 250; break;
                            case 3:
                                break; }
                    sleep2 250; }
                    break;
                case 3:
                    message strcharinfo(0),"Switch Classes:";
                    set .@i, Get_Menu(2,getarraysize(getvariableofnpc(.JobList,"CMSys")));
                    if (.@i == getarraysize(getvariableofnpc(.JobList,"CMSys"))) break;
                    if (Class == getvariableofnpc(.JobList[.@i],"CMSys")) {
                        message strcharinfo(0),"Class change failed."; close; }
                    message strcharinfo(0),"Select '"+jobname(getvariableofnpc(.JobList[.@i],"CMSys"))+"'?";
                    if (select("Yes:No") == 2) break;
                    Class_Change(.@i);
                    close;
                case 4:
                    if (BaseLevel < getvariableofnpc(.MaxLevel,"CMSys")) {
                        message strcharinfo(0),"You must be level "+getvariableofnpc(.MaxLevel,"CMSys")+" to use this."; sleep2 250; break; }
                    while(1) {
                        message strcharinfo(0),"Build Manager:";
                        switch(select(" > Save Build...: > Load Build...: > Rename Build...: > ^777777Back^000000")) {
                            case 1:
                                message strcharinfo(0),"Build Manager > Save Build:";
                                set .@build, Get_Menu(3,getvariableofnpc(.BuildCount,"CMSys"));
                                if (.@build == getvariableofnpc(.BuildCount,"CMSys")+1) break;
                                if (getd("Build_"+.@build+"$")!="") {
                                    message strcharinfo(0),"Overwrite previous build #"+.@build+"?";
                                    if(select("Save new build:Cancel")==2) break; }
                                Save_Build(.@build);
                                message strcharinfo(0),"Type a name for your build.";
                                input getd("Build_"+.@build+"n$");
                                message strcharinfo(0),"Build #"+.@build+" ("+getd("Build_"+.@build+"n$")+") saved.";
                                sleep2 250; break;
                            case 2:
                                message strcharinfo(0),"Build Manager > Load Build:";
                                set .@build, Get_Menu(3,getvariableofnpc(.BuildCount,"CMSys"));
                                if (.@build == getvariableofnpc(.BuildCount,"CMSys")+1) break;
                                if (getd("Build_"+.@build+"$")=="") {
                                    message strcharinfo(0),"No build info found."; sleep2 250; break; }
                                Load_Build(getd("Build_"+.@build+"$"));
                                message strcharinfo(0),"Build #"+.@build+" loaded.";
                                sleep2 250; break;
                            case 3:
                                message strcharinfo(0),"Build Manager > Rename Build:";
                                set .@build, Get_Menu(3,getvariableofnpc(.BuildCount,"CMSys"));
                                if (.@build == getvariableofnpc(.BuildCount,"CMSys")+1) break;
                                if (getd("Build_"+.@build+"$")=="") {
                                    message strcharinfo(0),"No build info found."; sleep2 250; break; }
                                message strcharinfo(0),"Type a new name for Build #"+.@build+" ("+getd("Build_"+.@build+"n$")+").";
                                input getd("Build_"+.@build+"n$");
                                message strcharinfo(0),"Build #"+.@build+" renamed.";
                                sleep2 250; break;
                            case 4:
                                set .@j,1; break; }
                    if (.@j) { set .@j,0; break; }
                    sleep2 250; }
                    break;
                case 5:
                    close; }
            sleep2 250; }
    
        function Class_Change {
            specialeffect2 348;
            if (getvariableofnpc(.Interrupt,"CMSys")) {
                message strcharinfo(0),"Casting...";
                initnpctimer "CMSys",1;
                progressbar "", getvariableofnpc(.CastTime,"CMSys"); }
            else for(set .@i,0; .@i<getvariableofnpc(.CastTime,"CMSys"); set .@i,.@i+1) {
                message strcharinfo(0),(getvariableofnpc(.CastTime,"CMSys")-.@i)+" seconds remaining...";
                sleep2 1000; }
            jobchange getvariableofnpc(.JobList[getarg(0)],"CMSys");
            set JobLevel, getvariableofnpc(.JLvlMax[getarg(0)],"CMSys");
            atcommand "@allskill";
            set SkillPoint,0;
            skilleffect 292,0;
            return; }
        function Get_Menu {
            set .@menu$,"";
            switch(getarg(0)) {
                case 1:
                    deletearray @QC1[0],getarraysize(@QC1);
                    deletearray @QC2[0],getarraysize(@QC2);
                    setarray .@ar$[0],"*","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z";
                    set .@s$,"_";
                    for(set .@i,1; .@i<=getstrlen(QC1$); set .@i,.@i+1)
                        for(set .@j,0; .@j<27; set .@j,.@j+1)
                            if (compare(QC1$,.@s$+.@ar$[.@j])) {
                                set @QC1[.@i], .@j;
                                set .@s$, .@s$+.@ar$[.@j];
                                break; }
                    set .@s$,"_";
                    for(set .@i,1; .@i<=getstrlen(QC2$); set .@i,.@i+1)
                        for(set .@j,0; .@j<27; set .@j,.@j+1)
                            if (compare(QC2$,.@s$+.@ar$[.@j])) {
                                set @QC2[.@i], .@j;
                                set .@s$, .@s$+.@ar$[.@j];
                                break; }
                    for(set .@i,1; .@i<=getarg(1); set .@i,.@i+1)
                        set .@menu$, .@menu$+" > "+((@QC1[.@i])?"^0055FF"+jobname(getvariableofnpc(.JobList[@QC1[.@i]],"CMSys")):"^777777no job")+"^000000 / build "+((@QC2[.@i])?"^0055FF"+@QC2[.@i]:"^777777empty")+"^000000:";
                    set .@menu$, .@menu$+" > ^777777Back^000000";
                    break;
                case 2:
                    for(set .@i,1; .@i<getarg(1); set .@i,.@i+1) {
                        if (Class_Mastery & pow(2,.@i))
                            set .@menu$, .@menu$+" > "+jobname(getvariableofnpc(.JobList[.@i],"CMSys"));
                        set .@menu$, .@menu$+":"; }
                    set .@menu$, .@menu$+" > ^777777Back^000000";
                    break;
                case 3:
                    for(set .@i,1; .@i<=getarg(1); set .@i,.@i+1)
                        set .@menu$, .@menu$+" > Slot "+.@i+" ("+((getd("Build_"+.@i+"n$")=="")?"^777777empty":"^0055FF"+getd("Build_"+.@i+"n$"))+"^000000):";
                    if (getarg(2,0)) set .@menu$, .@menu$+" > No build:";
                    set .@menu$, .@menu$+" > ^777777Back^000000";
                    break; }
            return select(.@menu$); }
        function Save_Build {
            setarray .@ar$[0],"a","b","c","d","e","f","g";
            set .@s$,"";
            for(set .@i,0; .@i<7; set .@i,.@i+1)
                set .@s$,.@s$+.@ar$[.@i]+((.@i==6)?StatusPoint:readparam(.@i+13))+"|";
            setd "Build_"+getarg(0)+"$", .@s$;
            return; }
        function Load_Build {
            setarray .@num$[0],"0","1","2","3","4","5","6","7","8","9";
            setarray .@ar$[0],"a","b","c","d","e","f","g";
            ResetStatus;
            for(set .@j,13; .@j<20; set .@j,.@j+1) {
                set .@var$,"";
                set .@s$,.@ar$[.@j-13];
                while(1) {
                    for(set .@i,0; .@i<10; set .@i,.@i+1) {
                        if (compare(getarg(0),.@s$+.@num$[.@i])) {
                            set .@var$,.@var$+.@num$[.@i];
                            set .@s$,.@s$+.@num$[.@i];
                            break; }
                    } if (compare(getarg(0),.@s$+"|")) break; }
            if (.@j==19) set StatusPoint, atoi(.@var$);
            else statusup2 .@j, atoi(.@var$)-1; }
            return; }
    }

     

     

  2. I would like to limit only the maximum deposit when using the Bank Agent i could not find any related to this so i decided to post it up here is the raw script.

    //===== rAthena Script ======================================= 
    //= Banker Script 
    //===== By: ================================================== 
    //= Syrus22 (1.0)
    //===== Current Version: ===================================== 
    //= 2.0
    //===== Compatible With: ===================================== 
    //= rAthena Project
    //===== Description: ========================================= 
    //= An account wide Banker to store Zeny
    //===== Additional Comments: ================================= 
    //= Syrus22 - There's an optional transaction fee at the top of
    //= the script. To use it simply change the first set command
    //= to set the cost variable to whatever you want the fee to be.
    //= Version 2.0: Optimized and brought the script up to standard. [Jguy]
    //============================================================ 
    
    prontera,132,217,5	script	Banker	109,{
    	set @cost,500;
    	mes "[Banker]";
    	mes "Welcome to the First Bank of Prontera. How can I help you today?";
    	next;
    	switch(select("I'd like to make a deposit.:I'd like to make a withdrawal.:What's my current balance?:Cancel")) {
    	case 1:
    		mes "[Banker]";
    		mes "Very well... How much would you like to deposit? The maximum you can deposit at once is 999,999 Zeny.";
    		next;
    		if (@cost > 0) {
    			mes "[Banker]";
    			mes "Oh, and do realize there is a " +@cost + " Zeny charge on all transactions!";
    			next;
    		}
    		input @deposit;
    		if (@deposit < 1) {
    			mes "Make sure you ask me to deposit a real amount.";
    			close;
    		}
    		else if (@deposit > Zeny) {
    			mes "It does not appear like you have the amount of zeny you're trying to deposit!";
    			close;
    		}
    		else if (@deposit > (Zeny - @cost)) {
    			mes "You need " + @cost + " Zeny to cover the transaction fee!";
    			close;
    		}
    		else {
    			set Zeny,Zeny - @deposit;
    			set Zeny,Zeny - @cost;
    			set #bankstorage,#bankstorage + @deposit;
    			mes "[Banker]";
    			mes "Thank you very much... Your zeny is in good hands.";
    			close;
    		}
    	case 2:
    		mes "[Banker]";
    		mes "Very well... How much would you like to withdraw? The maximum you can withdraw at one time is 999,999 Zeny";
    		next;
    		if (@cost > 0) {
    			mes "[Banker]";
    			mes "Oh, and do realize there is a " +@cost + " Zeny charge on all transactions!";
    			next;
    		}
    		input @withdrawl;
    		if (@withdrawl < 1) {
    			mes "Please don't play games. I need a real amount to withdraw.";
    			close;
    		}
    		else if (@withdrawl > #bankstorage) {
    			mes "You only have ^00FF00" + callfunc("F_InsertComma",#bankstorage) +"^000000 zeny in your account!";
    			close;
    		}
    		else if ((@cost > Zeny) && ((Zeny + @withdrawl) > @cost)) {
    			mes "[Banker]";
    			mes "You don't have the Zeny for the transaction fee right now. Would you like me to take the fee directly from your withdrawal?";
    			next;
    			switch(select("Yes please.:No, Thanks")){
    			case 1:
    				mes "[Banker]";
    				mes "Removing " + @cost + " from your withdrawal to cover the deposit fee...";
    				set @withdrawl,@withdrawl - @cost;
    				set #bankstorage,#bankstorage - @cost;
    				set @cost,0;
    				next;
    				set Zeny,Zeny - @cost;
    				set Zeny,Zeny + @withdrawl;
    				set #bankstorage,#bankstorage - @withdrawl;
    				mes "[Banker]";
    				mes "There's your Zeny. Have a good day.";
    				close;
    			case 2:
    				mes "[Banker]";
    				mes "Very well... come again soon.";
    				close;
    			}
    		}
    		else {
    			set Zeny,Zeny - @cost;
    			set Zeny,Zeny + @withdrawl;
    			set #bankstorage,#bankstorage - @withdrawl;
    			mes "[Banker]";
    			mes "There's your Zeny. Have a good day.";
    			close;
    		}
    	case 3:
    		mes "[Banker]";
    		mes "Hmmmm... let me check some paper work.";
    		next;
    		mes "*Rustle, Rustle*";
    		next;
    		mes "[Banker]";
    		mes "You currently have " + callfunc("F_InsertComma",#bankstorage) + " Zeny in your account.";
    		close;
    	case 4:
    		mes "[Banker]";
    		mes "Very well... come again soon.";
    		close;
    	}
    }

     

  3. I would love to know how could i seperate a weapon and a shield

     I wanted to create a menu that can only Read Shields and Weapons + Both hands on another one

    			setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_R, EQI_HAND_L,EQI_GARMENT,EQI_SHOES,EQI_ACC_L,EQI_ACC_R;
    			for(.@i = 1; .@i<getarraysize(.@indices); ++.@i) {
    				if( getequipisequiped( .@indices[.@i] ) ) {
    					.@menu$ +=   F_getpositionname(.@indices[.@i]) + "-[" + getequipname(.@indices[.@i]) + "]^000000";
    					.@equipped = 1;
    				}
    				.@menu$ += ":";
    			}
    			if(!.@equipped){
    				
    				end;
    			}

    i want to put this but idk how this is for Shield Only.

    getiteminfo( getequipid( EQI_HAND_L ),2 ) != 4 )

     

  4. On 3/4/2023 at 1:46 AM, sader1992 said:

    instead of

    .@gid = <Group ID>;

    Use

    .@gid = .@eq;

    now this is the group ID for each location

    EQI_ACC_L (0)             - Accessory 1
    EQI_ACC_R (1)             - Accessory 2
    EQI_SHOES (2)             - Footgear (shoes, boots)
    EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
    EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
    EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
    EQI_HEAD_TOP (6)          - Upper Headgear
    EQI_ARMOR (7)             - Armor (jackets, robes)
    EQI_HAND_L (8)            - Left hand (weapons, shields)
    EQI_HAND_R (9)            - Right hand (weapons)
    EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
    EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
    EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
    EQI_COSTUME_GARMENT (13)  - Costume Garment
    EQI_AMMO (14)    		  - Arrow/Ammunition
    EQI_SHADOW_ARMOR (15)     - Shadow Armor
    EQI_SHADOW_WEAPON (16)    - Shadow Weapon
    EQI_SHADOW_SHIELD (17)    - Shadow Shield
    EQI_SHADOW_SHOES (18)     - Shadow Shoes
    EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
    EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1

     

    How would i add for left accessory since you can only add group starting 1?

  5. 	set .@menu$, "";
    	set .@a, .orbs[0];
    	while((set(.@a,.@a+1)-1)<=.orbs[1])
    		if(getiteminfo(.@a-1,2)>-1)
    			if(set(.@c,countitem(.@a-1))) {
    				set .@menu$, .@menu$+getitemname(.@a-1)+" x"+.@c+":";
    				set .@b,.@b+1; set .@item[.@b], .@a-1;
    			}
    			
    	if(.@menu$=="") {
    		mes .npc$;
    		mes "Hmm, you don't seem to have any enchantment orbs.";
    		close;
    	}
    
    	mes .npc$;
    	mes "Please, select an enchantment from the menu."; next;
    	select(.@menu$);
    	set .@itm, .@item[@menu];
        
        
        setarray .orbs,	4702,4712,4722,4732,4742,4752,4767,4834; 

     

  6. On 10/11/2019 at 10:59 PM, BeWan said:

    tried and tested. working 100%

     

    prontera,156,178,5	script	BeWan Enchanter	100,{
    	mes "do you want to enchant your equipment ?";
    	next;
    	.@s = select( .menu$ ) -1;
    	if ( !getequipisequiped( .const_equip[.@s] ) || .const_equip[.@s] == EQI_HAND_L && getiteminfo( getequipid( EQI_HAND_L ),2 ) != 5 ) {
    		mes "you did not equip an "+ .menu_name$[.@s] +" at the moment";
    		close;
    	}
    	.@id = getequipid( .const_equip[.@s] );
    	.@ref = getequiprefinerycnt( .const_equip[.@s] );
    	.@card1 = getequipcardid( .const_equip[.@s], 0 );
    	.@card2 = getequipcardid( .const_equip[.@s], 1 );
    	.@card3 = getequipcardid( .const_equip[.@s], 2 );
    	.@card4 = getequipcardid( .const_equip[.@s], 3 );
    	if ( .@card1 == 255 || .@card1 == 254 ) {
    		mes "I can't enchant a signed equipment";
    		close;
    	}
    	if ( .@card4 ) {
    		mes "this armor has already enchanted";
    		close;
    	}
    	
    	if ( countitem( 7773 ) < 50 || countitem( 7227 ) < 50  ) {
    	mes "Sorry, you need 50 "+ getitemname( 7773 ) +" and 50 "+ getitemname( 7227 ) +" to enchant this armor.";
    	close;
    	}
    	
    	.@rand = rand(.totalchance);
    	while ( ( .@rand = .@rand - .rate[.@r] ) >= 0 ) .@r++;
    	.@o = rand(0,5);
    
    	delitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, 0;
    	getitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, 4700 + .@o * 10 + .@r;
    	equip .@id;
    	close;
    OnInit:
    	setarray .rate, 55,50,45,40,35; // rate of getting +1 is 55%, +2 is 50% .... +10 is 10% ...
    
    	setarray .const_equip, EQI_ARMOR, EQI_HAND_L, EQI_GARMENT, EQI_SHOES;
    	setarray .menu_name$, "Armor", "Shield", "Garment", "Shoes";
    	.menu$ = implode( .menu_name$,":" );
    	while ( .@i < 10 ) {
    		.totalchance = .totalchance + .rate[.@i];
    		.@i++;
    	}
    	end;
    }

     

     

    can you do setarray list of orbs instead of str,agi,vit,int,dex,luk 1~10

  7. On 2/27/2023 at 10:00 PM, Slammer said:

    why not use it like a rental item? it's easier than like the reference you gave.
    From my logic, if you use the references you provided, you might need a month's rent for supporting items

    i want the item to be a permanent though

×
×
  • Create New...