Jump to content

Question

2 answers to this question

Recommended Posts

Posted
prontera,150,150,0    script    Sample    100,{
    mes .NPC$;
    mes "Hello there, " + strcharinfo(0)+ ". I can change your name! Would you like it?";
    mes "The change name service will cost " +.AMOUNT+ "x " +getitemname(.ID)+ ".";
    next;
    if (select("Yes:No") - 1) close;
    mes .NPC$;
    mes "Let me first check if you comply with my requirements.";
    next;
    if (countitem(.ID) < .AMOUNT) {
        mes .NPC$;
        mes "You do not comply with my requirements.";
        mes "My requirements : ";
        mes "- " +getitemname(.ID)+ " " +.AMOUNT+ "x";
        close;
    }
    mes .NPC$;
    mes "This is interesting! You have my requirements. Let's start the transaction.";
    next;
    mes .NPC$;
    mes "Enter your desired new name";
    next;
    input .@new$;
    mes .NPC$;
    mes "So you want to do the following : ";
    mes "Current Name : " +strcharinfo(0);
    mes "New Name : " +.@new$;
    next;
    if (select("Yes:No") - 1) close;
    mes .NPC$;
    mes "Updating your name....";
    query_sql "UPDATE `char` SET `name` = '"+escape_sql(.@new$)+"' WHERE `char_id` = '"+getcharid(0)+"'";
    next;
    mes .NPC$;
    delitem .ID, .AMOUNT;
    mes "This has been done for you. You must relog to see the effects. You want me to relog you?";
    next;
    if (select("Yes:No") - 1) {
        mes .NPC$;
        mes "Okay then bye!";
        close;
    }
    atcommand "@kick " +strcharinfo(0);
    end;

    OnInit:
        set .NPC$,"[ " +strnpcinfo(1)+ " ]";
        set .ID,674;
        set .AMOUNT,4;
        end;
}

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...