- //===== Bakamono's Script ====================================
- //= Character Manager
- //===== By: ==================================================
- //= Bake Mono
- //===== Current Version: =====================================
- //= 1.0
- //===== Description: =========================================
- //= Changes the positions of characters on the character
- //= selection screen. Can either move a character to an empty
- //= spot, or swap two characters at once for a Fee. The fee
- //= is defaulted to 250,000 zeny with coupons (7037) able to
- //= be used to avoid the fee.
- //===== Additional Comments: =================================
- //= 1.0
- //============================================================
- prontera,161,193,4 script Character Manager 899,{
- set .npcName$, "[^0000FFCharacter Manager^000000]";
- set .charAmt, 9;
- set .fee, 250000;
- mes .npcName$;
- mes "Welcome, how many I be of assistance to you today?";
- next;
- switch(prompt("Nevermind...","Switch character slots"))
- {
- case 1:
- mes .npcName$;
- mes "Understood. If you ever need assistance managing your characters, I'll be here.";
- close;
- case 2:
- mes .npcName$;
- mes "I can help you change the way your characters are organized on the character selection screen. To do this, you must select 2 different characters, or a character and an empty spot, and they will be automatically moved.";
- next;
- mes .npcName$;
- mes "You may also move a single character into an empty slot, if you have any. My services don't come free though. It costs "+.fee+" Zeny each time you you use it.";
- next;
- mes .npcName$;
- mes "Do you want to use my service and re-arrange your characters?";
- next;
- switch(select("No thanks...","Sure! "))
- {
- case 1:
- mes .npcName$;
- mes "Understood. If you ever decide to change your mind, I'll be here.";
- close;
- case 2:
- mes .npcName$;
- mes "Go ahead and select the ^0000FFfirst^000000 character that you want to swap positions or an empty slot...";
- next;
- query_sql("SELECT char_num,name FROM `char` WHERE account_id="+getcharid(3)+" ORDER BY char_num ASC", @char_num, @name$);
- callsub First;
- }
- }
- GetList:
- set .result$, "Nevermind..."; // Start result variable for menu
- for( set .@i, 0; .@i < .charAmt; set .@i, .@i +1 )
- {
- if(@char_num[.@i-.@offset]!=.@i)
- {
- set .@offset, .@offset+1;
- set .result$, .result$ + ":^990000--Empty--^000000";
- setarray @charArray[.@i],.@i;
- setarray @charArray$[.@i],"--Empty--";
- }
- else
- {
- set .@charCnt, .@i + 1;
- set .result$, .result$ + ":^000099["+.@charCnt+"] --- "+@name$[.@i-.@offset]+"^000000";
- setarray @charArray[.@i],@char_num[.@i-.@offset];
- setarray @charArray$[.@i],@name$[.@i-.@offset];
- }
- }
- return;
- First:
- callsub GetList;
- switch(select(.result$))
- {
- case 1:
- mes .npcName$;
- mes "Understood. If you ever decide to change your mind, I'll be here.";
- close;
- case 2: set @pickOneNum, @charArray[0]; set @pickOneName$, @charArray$[0]; callsub Second;
- case 3: set @pickOneNum, @charArray[1]; set @pickOneName$, @charArray$[1]; callsub Second;
- case 4: set @pickOneNum, @charArray[2]; set @pickOneName$, @charArray$[2]; callsub Second;
- case 5: set @pickOneNum, @charArray[3]; set @pickOneName$, @charArray$[3]; callsub Second;
- case 6: set @pickOneNum, @charArray[4]; set @pickOneName$, @charArray$[4]; callsub Second;
- case 7: set @pickOneNum, @charArray[5]; set @pickOneName$, @charArray$[5]; callsub Second;
- case 8: set @pickOneNum, @charArray[6]; set @pickOneName$, @charArray$[6]; callsub Second;
- case 9: set @pickOneNum, @charArray[7]; set @pickOneName$, @charArray$[7]; callsub Second;
- case 10: set @pickOneNum, @charArray[8]; set @pickOneName$, @charArray$[8]; callsub Second;
- case 11: set @pickOneNum, @charArray[9]; set @pickOneName$, @charArray$[9]; callsub Second;
- case 12: set @pickOneNum, @charArray[10]; set @pickOneName$, @charArray$[10]; callsub Second;
- case 13: set @pickOneNum, @charArray[11]; set @pickOneName$, @charArray$[11]; callsub Second;
- case 14: set @pickOneNum, @charArray[12]; set @pickOneName$, @charArray$[12]; callsub Second;
- case 15: set @pickOneNum, @charArray[13]; set @pickOneName$, @charArray$[13]; callsub Second;
- case 16: set @pickOneNum, @charArray[14]; set @pickOneName$, @charArray$[14]; callsub Second;
- case 17: set @pickOneNum, @charArray[15]; set @pickOneName$, @charArray$[15]; callsub Second;
- case 18: set @pickOneNum, @charArray[16]; set @pickOneName$, @charArray$[16]; callsub Second;
- case 19: set @pickOneNum, @charArray[17]; set @pickOneName$, @charArray$[17]; callsub Second;
- case 20: set @pickOneNum, @charArray[18]; set @pickOneName$, @charArray$[18]; callsub Second;
- case 21: set @pickOneNum, @charArray[19]; set @pickOneName$, @charArray$[19]; callsub Second;
- case 22: set @pickOneNum, @charArray[20]; set @pickOneName$, @charArray$[20]; callsub Second;
- }
- Second:
- mes .npcName$;
- mes "Now select the ^FF0000second^000000 character you want to change. Either the first, second, or both selections must be a character. You can not choose 2 empty slots...";
- next;
- callsub GetList;
- switch(select(.result$))
- {
- case 1: mes .npcName$; mes "Understood. If you ever decide to change your mind, I'll be here."; close;
- case 2: set @pickTwoNum, @charArray[0]; set @pickTwoName$, @charArray$[0]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 3: set @pickTwoNum, @charArray[1]; set @pickTwoName$, @charArray$[1]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 4: set @pickTwoNum, @charArray[2]; set @pickTwoName$, @charArray$[2]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 5: set @pickTwoNum, @charArray[3]; set @pickTwoName$, @charArray$[3]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 6: set @pickTwoNum, @charArray[4]; set @pickTwoName$, @charArray$[4]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 7: set @pickTwoNum, @charArray[5]; set @pickTwoName$, @charArray$[5]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 8: set @pickTwoNum, @charArray[6]; set @pickTwoName$, @charArray$[6]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 9: set @pickTwoNum, @charArray[7]; set @pickTwoName$, @charArray$[7]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 10: set @pickTwoNum, @charArray[8]; set @pickTwoName$, @charArray$[8]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 11: set @pickTwoNum, @charArray[9]; set @pickTwoName$, @charArray$[9]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 12: set @pickTwoNum, @charArray[10]; set @pickTwoName$, @charArray$[10]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 13: set @pickTwoNum, @charArray[11]; set @pickTwoName$, @charArray$[11]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 14: set @pickTwoNum, @charArray[12]; set @pickTwoName$, @charArray$[12]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 15: set @pickTwoNum, @charArray[13]; set @pickTwoName$, @charArray$[13]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 16: set @pickTwoNum, @charArray[14]; set @pickTwoName$, @charArray$[14]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 17: set @pickTwoNum, @charArray[15]; set @pickTwoName$, @charArray$[15]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 18: set @pickTwoNum, @charArray[16]; set @pickTwoName$, @charArray$[16]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 19: set @pickTwoNum, @charArray[17]; set @pickTwoName$, @charArray$[17]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 20: set @pickTwoNum, @charArray[18]; set @pickTwoName$, @charArray$[18]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 21: set @pickTwoNum, @charArray[19]; set @pickTwoName$, @charArray$[19]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- case 22: set @pickTwoNum, @charArray[20]; set @pickTwoName$, @charArray$[20]; callsub Check, @pickOneNum, @pickOneName$, @pickTwoNum, @pickTwoName$;
- }
- Check:
- set .@pickOne, getarg(0)+1;
- set .@pickTwo, getarg(2)+1;
- mes .npcName$;
- mes "Are you sure you want ^0000FF" + @pickOneName$+"^000000 and ^FF0000" + @pickTwoName$ + "^000000 to switch positions?";
- next;
- switch(select("No","Yes"))
- {
- case 1:
- mes .npcName$;
- mes "Understood. If you ever decide to change your mind, I'll be here waiting.";
- close;
- case 2:
- mes .npcName$;
- if(getarg(0) == getarg(2) || getarg(1) == getarg(3)) { mes "Nothing has changed positions. Have a nice day."; close; }
- else if(getarg(1) == "--Empty--" && getarg(2) < .charAmt)
- {
- callsub Fee_Check;
- query_sql "UPDATE `char` SET `char_num` = '"+getarg(0)+"' WHERE `account_id` = "+getcharid(3)+" AND char_num="+getarg(2);
- mes getarg(3) + " has moved from position " + .@pickTwo + " to position " + .@pickOne + ". Thank you for using the character manager, have a nice day.";
- close;
- }
- else if(getarg(0) < .charAmt && getarg(3) == "--Empty--")
- {
- callsub Fee_Check;
- query_sql "UPDATE `char` SET `char_num` = '"+getarg(2)+"' WHERE `account_id` = "+getcharid(3)+" AND char_num="+getarg(0);
- mes getarg(1) + " has moved from position " + .@pickOne + " to position " + .@pickTwo + ". Thank you for using the character manager, have a nice day.";
- close;
- }
- else if(getarg(0) < .charAmt && getarg(2) < .charAmt)
- {
- callsub Fee_Check;
- query_sql "UPDATE `char` SET `char_num` = '99' WHERE `account_id` = "+getcharid(3)+" AND char_num="+getarg(0);
- query_sql "UPDATE `char` SET `char_num` = '"+getarg(0)+"' WHERE `account_id` = "+getcharid(3)+" AND char_num="+getarg(2);
- query_sql "UPDATE `char` SET `char_num` = '"+getarg(2)+"' WHERE `account_id` = "+getcharid(3)+" AND char_num=99";
- mes getarg(1) + " and " + getarg(3) + " have swapped positions. Thank you for using the character manager, have a nice day.";
- close;
- }
- }
- Fee_Check:
- if(countitem(7037) > 0) // Coupon
- {
- mes "It seems you have a coupon. Would you like to use this coupon instead of paying the fee?";
- next;
- switch(select("Yes","No"))
- {
- case 1: delitem 7037,1; return;
- case 2: break;
- }
- }
- if(Zeny >= .fee) { set Zeny, Zeny-.fee; return; }
- else
- {
- mes .npcName$;
- mes "You do not have enough Zeny to use this service. Please come back when you have enough to pay for it.";
- close;
- }
- }
Character Manager
Posted by Anonymous on Sat 3rd Dec 2011 00:53
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.