Jump to content
  • 0

Requesting for Credit Agent modification


Kudo

Question


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  132
  • Reputation:   0
  • Joined:  08/18/12
  • Last Seen:  

Quote

//==== DarkRO Scripts ====================================
//= Credit Exchanger
//===== By: ================================================== 
//=
//===== Current Version: ===================================== 
//= 1.4
//===== Description: ========================================= 
//= Allow to Convert Zeny into a Ticket.
//===== Changelog: =========================================== 
//= Not yet tested for bugs
//= 1.0 Implementation
//= 1.1 Re-script (added quest)
//= 1.2 Automated zeny-to-credit exchange and vice-versa
//= 1.3 Added @security checking.
//= 1.4 Added Black Credit Exchange feature
//============================================================

-    script    Credit Agent    -1,{

    set @header$,"[^FF8000 Credit Agent ^000000]";

    if (checksecurity()) {
        message strcharinfo(0), "You can't do this action, Protected by @security.";
        end;
    }

    if(#CREDITPASSPORT > gettimetick(2)) {
    disable_items;
    setpcblock(PCBLOCK_COMMANDS, true, getcharid(3));
    getinventorylist();
    mes @header$;
    mes "Hello, I can see that you still have your Intergalactical Passport.";
    mes " ";
    mes "What can I do for you?";
    next;
    switch(prompt("I want to change Zeny to Credit:I want to change Credit to Zeny.:Nothing, just passing by.")){
    case 255:
        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
        break;
    case 1:
        if (@inventorylist_count == MAX_INVENTORY && !countitem(Credit)) {
            setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
            mes @header$;
            mes "You need to clear your inventory first.";
            close();
        }
        mes @header$;
        mes "The exchange rate is fixed and its ^00008810,000,000^000000 Zeny = 1 ^FF0000Credit^000000.";
        mes " ";
        mes "How will you exchange your Zeny?";
        next;
        .@i = prompt("Decide on how many Credits I need.:Exchange all my Zeny:Cancel");
        if (.@i == 3) goto L_Cancel;
        else if (.@i == 255) {
            setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
            break;
        }
        else if (.@i == 1) {
            mes @header$;
            mes "How much Credits do you need?";
            mes " ";
            mes "^FF0000(Enter '0' to cancel the transaction)^000000";
            next;
            input @ZTC;
            if (@ZTC <= 0) goto L_Cancel;
            else if (@ZTC > MAX_ZENY / 10000000) {
                L_Exceed:
                setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                mes @header$;
                mes "Sorry, but you have";
                mes "exceeded from the limit.";
                close();
            } else if (@ZTC > Zeny / 10000000) {
                L_LessZeny:
                setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                mes @header$;
                mes "You don't have enough zeny.";
                close();
            } else {
                L_ConvertZTC:
                mes @header$;
                mes "You will be receiving ^FF0000"+@ZTC+" Credit"+(@ZTC != 1 ? "s":"")+"^000000.";
                mes " ";
                mes "Proceed?";
                next;
                .@menu = prompt("I changed my mind:Proceed!");
                if (.@menu == 1) {
                    setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                    close();
                    break;
                } 
                if (.@menu == 255) {
                    setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                    break;
                }
                setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                Zeny -= @ZTC * 10000000;
                getitem 40000, @ZTC;
                mes @header$;
                mes "Here you go!";
                mes "Thank you for using our service.";
                close();
            }
        } else {
            @ZTC = Zeny / 10000000;
            if (@ZTC == 0) goto L_LessZeny;
            else goto L_ConvertZTC;
        }
        break;
    case 2: goto L_ConvertCTZ_Main;
        break;
    default: 
        L_Cancel:
        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
        mes @header$;
        mes "Please do come back, Have a nice day!.";
        close;
        break;
    }
    end;
}

    if(#CRED_Q == 1) {
    disable_items;
    setpcblock(PCBLOCK_COMMANDS, true, getcharid(3));
    mes @header$;
    mes "Welcome back!, "+strcharinfo(0)+".";
    mes "Do you have the items I asked for?";
    next;
    switch(prompt("Yes, here they are!:What do I need again?:I want to change Credit to Zeny.:Not yet.")){
    case 255:
        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
        break;
    case 1:
        if((countitem(40013) < 1) || (countitem(40014) < 100) || (Zeny < 100000000)){
            setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
            mes @header$;
            mes "I think you are missing something this is the list that i needed:";
            mes "- 1 ^FF0000Intergalactical Coin^000000,";
            mes "- 100 ^FF0000Poring Jewels^000000,";
            mes "and also ^FF0000100,000,000 Zeny^000000.";
            close;
        }
        next;
        mes @header$;
        mes "Congratulations, Enjoy your Intergalactical Passport.";
        mes " ";
        mes "You may now use Zeny to ^FF0000Credit^000000 services in a matter of time.";
        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
        delitem 40013,1;
        delitem 40014,100;
        Zeny -= 100000000;
        #CREDITPASSPORT = 1728000+ gettimetick(2);
        #CRED_Q = 0;
        close;
        break;
    case 2: 
        mes @header$;
        mes "You will have to bring me the following:";
        mes "- 1 ^FF0000Intergalactical Coin^000000,";
        mes "- 100 ^FF0000Poring Jewels^000000,";
        mes "and also ^FF0000100,000,000 Zeny^000000.";
        next;
        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
        mes @header$;
        mes "I suggest you look for Simon in Prontera. He is known as gumbling master that could provide you tickets.";
        mes " ";
        mes "I'll be waiting for you!";
        close;
        break;
    case 3: 
        goto L_ConvertCTZ_Main;
        break;
    case 4: 
        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
        mes @header$;
        mes "Okay, Hurry up!";
        close;
        break;
    }
}

    mes @header$;
    mes "Hello, It looks like you don't have an Intergalactical Passport yet.";
    mes " ";
    mes "Would you like to have one?";
    next;
    switch(prompt("Yes, I'd like to have one.:Intergalactical Passport? What is that?:I want to change Credit to Zeny.:No thanks!")){
    case 1:
        mes @header$;
        mes "Very well. You will have to bring me the following:";
        mes "- 1 ^FF0000Intergalactical Coin^000000,";
        mes "- 100 ^FF0000Poring Jewels^000000,";
        mes "and also ^FF0000100,000,000 Zeny^000000.";
        next;
        mes @header$;
        mes "I suggest you look for Simon in Prontera. He is known as gumbling master that could provide you tickets.";
        mes " ";
        mes "I'll be waiting for you!";
        #CRED_Q = 1;
        close;
        break;
    case 2:
        mes @header$;
        mes "An Intergalactical Passport is required to use the Intergalactical currency: ^FF0000Credit^000000.";
        mes " ";
        mes "The value of ^FF0000Credit^000000 is equivalent to ^00008810,000,000^000000 Zeny.";
        next;
        mes @header$;
        mes "Once you have this passport, You can exchange Zeny to ^FF0000Credit^000000 with any Credits Agents in major towns.";
        next;
        mes @header$;
        mes "^FF0000NOTE^000000: That the passport is not required when exchanging ^FF0000Credit^000000 to Zeny.";
        next;
        mes @header$;
        mes "That contract will last for 20 days. After that time, You will have to renew your passport.";
        close;
        break;
    case 3:
    disable_items;
    setpcblock(PCBLOCK_COMMANDS, true, getcharid(3));
    L_ConvertCTZ_Main:
        mes @header$;
        mes "The exchange rate is fixed and its 1 ^FF0000Credit^000000 = ^00008810,000,000^000000 Zeny.";
        mes " ";
        mes "How will you exchange your ^FF0000Credits^000000?";
        next;
        .@i = prompt("Decide how many Credits to exchange.:Exchange all my Credits:Cancel");
        if (.@i == 3) goto L_Cancel;
        else if (.@i == 255) {
            setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
            break;
        } else if (.@i == 1) {
            mes @header$;
            mes "How many ^FF0000Credits^000000 do you want to exchange?";
            mes " ";
            mes "^FF0000(Enter '0' to cancel transaction)^000000";
            next;
            input @CTZ;
            if (@CTZ <= 0) goto L_Cancel;
            else if (@CTZ > countitem(40000)) {
                L_LessCredit:
                setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                mes @header$;
                mes "You don't have enough Credits.";
                close();
            }
            else {
                @CTZ_ = Zeny%10000000;
                if (@CTZ_ > 0) @CTZ_ = ((MAX_ZENY/10000000) - (Zeny/10000000)) - 1;
                else @CTZ_ = (MAX_ZENY/10000000) - (Zeny/10000000);
                if (@CTZ > (MAX_ZENY/10000000) || @CTZ_ < @CTZ ) goto L_Exceed;
                if (@CTZ > countitem(40000)) goto L_LessCredit;
                L_ConvertCTZ:
                    mes @header$;
                    mes "You will be exchanging your ^FF0000"+@CTZ+" Credit"+(@CTZ != 1 ? "s":"")+"^000000.";
                    mes " ";
                    mes "Proceed?";
                    next;
                    .@menu = prompt("I changed my mind:Proceed!");
                    if (.@menu == 1) {
                        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                        close();
                        break;
                    }
                    if (.@menu == 255) {
                        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                        break;
                    }
                    delitem 40000, @CTZ;
                    Zeny += 10000000 * @CTZ;
                    message(strcharinfo(0), "You have received "+F_InsertComma(10000000 * @CTZ)+" Z.");
                    setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                    mes @header$;
                    mes "Here you go!";
                    mes "Thank you for using our service.";
                    close();
            }
            close();
        } else {
            @CTZ = countitem(40000);
            .@ZenyCap = (MAX_ZENY - Zeny) / 10000000;
            if (@CTZ == 0) goto L_LessCredit;
            if (@CTZ >= .@ZenyCap) @CTZ = .@ZenyCap;
            if (@CTZ == 0) goto L_Exceed;
            goto L_ConvertCTZ;
        }
        break;
    case 4:
        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
        mes @header$;
        mes "Please do come back, Have a nice day!.";
        close;
        break;
    }
}

// Duplicates
//prontera,132,215,5    duplicate(Credit Agent)    Credit Agent#prt    4_M_KHBOY
market,99,53,6    duplicate(Credit Agent)    Credit Agent#mall    4_M_KHBOY
 

Can Someone Edit this script
Remove Intergalactical Coin and poring jewel to requirements
if my credit count is max it will not proceed cause when i try to exchange my zeny to credit and i have 30k credit on my inventory it will proceed always and my zeny will gone but no additional in my credit cause its full
vice versa for credit to zeny if my zeny is max my credit less nothing happen to zeny

thank you in advanced.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  132
  • Reputation:   53
  • Joined:  06/02/12
  • Last Seen:  

Hi. please put scripts inside a code box next time, the indentation is all lost otherwise.

//==== DarkRO Scripts ====================================
//= Credit Exchanger
//===== By: ================================================== 
//=
//===== Current Version: ===================================== 
//= 1.4
//===== Description: ========================================= 
//= Allow to Convert Zeny into a Ticket.
//===== Changelog: =========================================== 
//= Not yet tested for bugs
//= 1.0 Implementation
//= 1.1 Re-script (added quest)
//= 1.2 Automated zeny-to-credit exchange and vice-versa
//= 1.3 Added @security checking.
//= 1.4 Added Black Credit Exchange feature
//============================================================

-	script	Credit Agent	-1,{

    set @header$,"[^FF8000 Credit Agent ^000000]";
    .@credit_id = 40000;	//Credit Item ID 

    if (checksecurity()) {
        message strcharinfo(0), "You can't do this action, Protected by @security.";
        end;
    }

    if(#CREDITPASSPORT > gettimetick(2)) {
    disable_items;
    setpcblock(PCBLOCK_COMMANDS, true, getcharid(3));
    getinventorylist();
    mes @header$;
    mes "Hello, I can see that you still have your Intergalactical Passport.";
    mes " ";
    mes "What can I do for you?";
 	mes " ";
 	mes "^FF0000Your current credit: " + F_InsertComma(countitem(.@credit_id)); 
    next;
    switch(prompt("I want to change Zeny to Credit:I want to change Credit to Zeny.:Nothing, just passing by.")){
    case 255:
        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
        break;
    case 1:
        if (@inventorylist_count == MAX_INVENTORY && !countitem(.@credit_id)) {
            setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
            mes @header$;
            mes "You need to clear your inventory first.";
            close();
        }
        mes @header$;
        mes "The exchange rate is fixed and its ^00008810,000,000^000000 Zeny = 1 ^FF0000Credit^000000.";
        mes " ";
        mes "How will you exchange your Zeny?";
        next;
        .@i = prompt("Decide on how many Credits I need.:Exchange all my Zeny:Cancel");
        if (.@i == 3) goto L_Cancel;
        else if (.@i == 255) {
            setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
            break;
        }
        else if (.@i == 1) {
            mes @header$;
            mes "How much Credits do you need?";
            mes " ";
            mes "^FF0000(Enter '0' to cancel the transaction)^000000";
            next;
            input @ZTC;
            if (@ZTC <= 0) goto L_Cancel;
            else if (@ZTC > MAX_ZENY / 10000000) {
                L_Exceed:
                setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                mes @header$;
                mes "Sorry, but you have";
                mes "exceeded from the limit.";
                close();
            } else if (@ZTC > Zeny / 10000000) {
                L_LessZeny:
                setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                mes @header$;
                mes "You don't have enough zeny.";
                close();
            } else {
                L_ConvertZTC:
                if (!checkweight(.@credit_id,@ZTC)) {
                	mes @header$;
                	mes "Sorry. You can't hold this amount of credit.";
                	mes "Such amount would exceed your weight limit.";
                	for(; @ZTC; @ZTC--)
                		if (checkweight(.@credit_id,@ZTC))
                			break;
                	if (@ZTC) {
                		mes "You can only hold up to " + @ZTC + ".";
                		mes "Would this amount do?";
                		next;
                		if (select("Ok, " + @ZTC + " is acceptable", "No, just cancel") == 2)
                			callsub L_Cancel;
                	}
                	else {
                		setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                		close;
                	}                	
                }
                mes @header$;
                mes "You will be receiving ^FF0000"+@ZTC+" Credit"+(@ZTC != 1 ? "s":"")+"^000000.";
                mes " ";
                mes "Proceed?";
                next;
                .@menu = prompt("I changed my mind:Proceed!");
                if (.@menu == 1) {
                    setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                    close();
                    break;
                } 
                if (.@menu == 255) {
                    setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                    break;
                }
                setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                Zeny -= @ZTC * 10000000;
                getitem .@credit_id, @ZTC;
                mes @header$;
                mes "Here you go!";
                mes "Thank you for using our service.";
                close();
            }
        } else {
            @ZTC = Zeny / 10000000;
            if (@ZTC == 0) goto L_LessZeny;
            else goto L_ConvertZTC;
        }
        break;
    case 2: goto L_ConvertCTZ_Main;
        break;
    default: 
        L_Cancel:
        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
        mes @header$;
        mes "Please do come back, Have a nice day!.";
        close;
        break;
    }
    end;
}

    if(#CRED_Q == 1) {
    disable_items;
    setpcblock(PCBLOCK_COMMANDS, true, getcharid(3));
    mes @header$;
    mes "Welcome back!, "+strcharinfo(0)+".";
    mes "Do you have what I asked for?";
    next;
    switch(prompt("Yes, here it is!:What do I need again?:I want to change Credit to Zeny.:Not yet.")){
    case 255:
        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
        break;
    case 1:
        if(Zeny < 100000000){
            setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
            mes @header$;
            mes "I think you are missing something this is the list that i needed:";
            mes "^FF0000100,000,000 Zeny^000000.";
            close;
        }
        next;
        mes @header$;
        mes "Congratulations, Enjoy your Intergalactical Passport.";
        mes " ";
        mes "You may now use Zeny to ^FF0000Credit^000000 services in a matter of time.";
        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
        Zeny -= 100000000;
        #CREDITPASSPORT = 1728000+ gettimetick(2);
        #CRED_Q = 0;
        close;
        break;
    case 2: 
        mes @header$;
        mes "You will have to bring me the following:";
        mes "^FF0000100,000,000 Zeny^000000.";
        next;
        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
        mes @header$;
        mes "I suggest you look for Simon in Prontera. He is known as gumbling master that could provide you tickets.";
        mes " ";
        mes "I'll be waiting for you!";
        close;
        break;
    case 3: 
        goto L_ConvertCTZ_Main;
        break;
    case 4: 
        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
        mes @header$;
        mes "Okay, Hurry up!";
        close;
        break;
    }
}

    mes @header$;
    mes "Hello, It looks like you don't have an Intergalactical Passport yet.";
    mes " ";
    mes "Would you like to have one?";
    next;
    switch(prompt("Yes, I'd like to have one.:Intergalactical Passport? What is that?:I want to change Credit to Zeny.:No thanks!")){
    case 1:
        mes @header$;
        mes "Very well. You will have to bring me the following:";
        mes "^FF0000100,000,000 Zeny^000000.";
        next;
        mes @header$;
        mes "I suggest you look for Simon in Prontera. He is known as gumbling master that could provide you tickets.";
        mes " ";
        mes "I'll be waiting for you!";
        #CRED_Q = 1;
        close;
        break;
    case 2:
        mes @header$;
        mes "An Intergalactical Passport is required to use the Intergalactical currency: ^FF0000Credit^000000.";
        mes " ";
        mes "The value of ^FF0000Credit^000000 is equivalent to ^00008810,000,000^000000 Zeny.";
        next;
        mes @header$;
        mes "Once you have this passport, You can exchange Zeny to ^FF0000Credit^000000 with any Credits Agents in major towns.";
        next;
        mes @header$;
        mes "^FF0000NOTE^000000: That the passport is not required when exchanging ^FF0000Credit^000000 to Zeny.";
        next;
        mes @header$;
        mes "That contract will last for 20 days. After that time, You will have to renew your passport.";
        close;
        break;
    case 3:
    disable_items;
    setpcblock(PCBLOCK_COMMANDS, true, getcharid(3));
    L_ConvertCTZ_Main:
        mes @header$;
        mes "The exchange rate is fixed and its 1 ^FF0000Credit^000000 = ^00008810,000,000^000000 Zeny.";
        mes " ";
        mes "How will you exchange your ^FF0000Credits^000000?";
        next;
        .@i = prompt("Decide how many Credits to exchange.:Exchange all my Credits:Cancel");
        if (.@i == 3) goto L_Cancel;
        else if (.@i == 255) {
            setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
            break;
        } else if (.@i == 1) {
            mes @header$;
            mes "How many ^FF0000Credits^000000 do you want to exchange?";
            mes " ";
            mes "^FF0000(Enter '0' to cancel transaction)^000000";
            next;
            input @CTZ;
            if (@CTZ <= 0) goto L_Cancel;
            else if (@CTZ > countitem(.@credit_id)) {
                L_LessCredit:
                setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                mes @header$;
                mes "You don't have enough Credits.";
                close();
            }
            else {
                @CTZ_ = Zeny%10000000;
                if (@CTZ_ > 0) @CTZ_ = ((MAX_ZENY/10000000) - (Zeny/10000000)) - 1;
                else @CTZ_ = (MAX_ZENY/10000000) - (Zeny/10000000);
                if (@CTZ > (MAX_ZENY/10000000) || @CTZ_ < @CTZ ) goto L_Exceed;
                if (@CTZ > countitem(.@credit_id)) goto L_LessCredit;
                L_ConvertCTZ:
                    mes @header$;
                    mes "You will be exchanging your ^FF0000"+@CTZ+" Credit"+(@CTZ != 1 ? "s":"")+"^000000.";
                    mes " ";
                    mes "Proceed?";
                    next;
                    .@menu = prompt("I changed my mind:Proceed!");
                    if (.@menu == 1) {
                        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                        close();
                        break;
                    }
                    if (.@menu == 255) {
                        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                        break;
                    }
                    delitem .@credit_id, @CTZ;
                    Zeny += 10000000 * @CTZ;
                    message(strcharinfo(0), "You have received "+F_InsertComma(10000000 * @CTZ)+" Z.");
                    setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
                    mes @header$;
                    mes "Here you go!";
                    mes "Thank you for using our service.";
                    close();
            }
            close();
        } else {
            @CTZ = countitem(.@credit_id);
            .@ZenyCap = (MAX_ZENY - Zeny) / 10000000;
            if (@CTZ == 0) goto L_LessCredit;
            if (@CTZ >= .@ZenyCap) @CTZ = .@ZenyCap;
            if (@CTZ == 0) goto L_Exceed;
            goto L_ConvertCTZ;
        }
        break;
    case 4:
        setpcblock(PCBLOCK_COMMANDS, false, getcharid(3));
        mes @header$;
        mes "Please do come back, Have a nice day!.";
        close;
        break;
    }
}

// Duplicates
//prontera,132,215,5    duplicate(Credit Agent)    Credit Agent#prt    4_M_KHBOY
market,99,53,6    duplicate(Credit Agent)    Credit Agent#mall    4_M_KHBOY

 

Edited by Racaae
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  132
  • Reputation:   0
  • Joined:  08/18/12
  • Last Seen:  

+1 solved thank you 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...