viewing paste [ Request ] Change Sex Per Characte | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
// =============================
/* Change Sex per Character: http://herc.ws/board/topic/14030-r-change-sex-per-character-gender/
    ----------------------------
    by: Legend
    compatible w/: Hercules
    ----------------------------
    Description:
    * It requires client 2014-10-22 or greater.
    * Performs change sex per character
    * Allows you to set requirements as many as you want.
    ----------------------------
    Comments:
    * Please report to me if bugs were found:
      Contact: http://herc.ws/board/user/5387-legend/
*/
// =============================
prontera,150,160,4  script  Request#8   4_F_NURSE,{
    mes "[ "+.n$+" ]";
    mes "How may I help you?";
    next;
    if (select("Change my character's sex","Nothing") != 1){
        mes "[ "+.n$+" ]";
        mes "Come back to me if you're well decided.";
        close;
    }
    .@is = getarraysize(.i);
    dispbottom "============";
    dispbottom "Requirements:";
    dispbottom "============";
    for ( .@a = 0; .@a < .@is; .@a += 2 ){
        dispbottom getitemname(.i[.@a])+" ("+countitem(.i[.@a])+"/"+.i[.@a+1]+")";
        if (countitem(.i[.@a]) < .i[.@a+1]){
            .@b++;
        }
    }
    if (.@b) {
        message strcharinfo(0), "The deal has been cancelled!";
        close;
    }
    for ( .@c = 0; .@c < .@is; .@c += 2 ){
        delitem .i[.@c], .i[.@c+1];
    }
    changecharsex;
    close;
 
OnInit:
    .n$ = "Nurse";
    // Requirements goes here
    // Syntax: <itemid1>,<amount>,<itemid2>,<amount>,...
    setarray .i[0],1001,3,1002,2,1003,1,1004,5,1005,10;
    end;
}
Viewed 1186 times, submitted by Legend.