viewing paste Unknown #31904 | Text

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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
/*
CREATE TABLE IF NOT EXISTS `ir_main` (
  `id` bigint(20) unsigned NOT NULL auto_increment,
  `account_id` int(11) unsigned NOT NULL,
  `item_id` int(11) unsigned NOT NULL,
  `amount` int(11) unsigned NOT NULL,
  `refine` tinyint(3) unsigned NOT NULL default '0',
  `card0` smallint(5) unsigned NOT NULL default '0',
  `card1` smallint(5) unsigned NOT NULL default '0',
  `card2` smallint(5) unsigned NOT NULL default '0',
  `card3` smallint(5) unsigned NOT NULL default '0',
  `ticket_id` int(11) unsigned NOT NULL default '0',
  `claim` tinyint(2) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
*/
 
prontera,169,181,5  script  Item Redeem 1_M_SIGNART,{
    mes "[ Item Redeem ]";
    mes "Select Option";
    .@menu$ = "Redeem Items:Cancel";
    if (getgmlevel()>=99)
        .@menu$ = .@menu$+":Add Items";
    switch(select(.@menu$)){
        case 3:
            if (getgmlevel() < 99)
                close;
            while(1){
                next;
                mes "[ Item Redeem ]";
                mes "Are you Sure you want to add items?";
                if (select("Add Items:Cancel") == 2)
                    close;
                next;
                mes "[ Item Redeem ]";
                mes "Enter Ticket ID";
                mes "0 if no TicketID";
                input .@ticket_id;
                next;
                mes "[ Item Redeem ]";
                mes "Enter AccountID";
                input .@acc_id;
                next;
                mes "[ Item Redeem ]";
                mes "How Many Items you want to put?";
                input .@count;
                for (.@i = 0; .@i < .@count; .@i++){
                    next;
                    mes "[ Item Redeem ]";
                    mes "["+ (.@i+1) +"/"+ .@count +"] Enter ItemID";
                    input .@item_id[.@i];
                    .@type = getiteminfo(.@item_id[.@i],2);
                    if (.@type == 4 || .@type == 5){
                        for (.@j=0; .@j < 4; .@j++){
                            next;
                            mes "[ Item Redeem ]";
                            mes "["+ (.@j+1) +"/4] Enter CardID";
                            mes "0 if no card on this slot.";
                            input .@card;
                            setd(".@cards_"+.@i+"_"+.@j,.@card);
                        }
                        next;
                        mes "[ Item Redeem ]";
                        mes "Enter Refine Amount.";
                        input .@refine[.@i];
                    }
                    next;
                    mes "[ Item Redeem ]";
                    mes "["+ (.@i+1) +"/"+ .@count +"] Enter Amount";
                    input .@amount[.@i];
                    next;
                    mes "[ Item Redeem ]";
                    mes "Review the Item:";
                    mes .@amount[.@i]+"x "+ getitemname(.@item_id[.@i]);
                    mes "Refine: "+ .@refine[.@i];
                    mes "Cards: ";
                    for (.@j = 0; .@j < 4; .@j++)
                        mes (.@j+1)+" Slot: "+ getitemname(getd(".@cards_"+.@i+"_"+.@j));
                    if (select("Item Info is Correct: Info is not correct, edit this item...") == 2){
                        //Remove Data which are not necessary, like cards and refines.
                        .@refine[.@i] = 0;
                        for (.@j=0; .@j < 4; .@j++)
                            setd(".@cards_"+.@i+"_"+.@j,0);
                        .@i--;
                    }
                    next;
                    mes "[ Item Redeem ]";
                    mes "Item Added...";
                }
                next;
                mes "Are you Sure to add all these items?";
                mes "Clicking No, will remove all the items, and you would have to redo..";
                for (.@i = 0; .@i < .@count; .@i++){
                    mes .@amount[.@i]+"x "+ getitemname(.@item_id[.@i]);
                }
                if (select("Yes, Add:No") == 2)
                    continue;
                for (.@i = 0; .@i < .@count; .@i++){
                    query_sql "INSERT INTO `ir_main` (`account_id`,`item_id`,`amount`,`refine`,`card0`,`card1`,`card2`,`card3`,`ticket_id`) VALUES ("+.@acc_id+","+.@item_id[.@i]+","+.@amount[.@i]+","+.@refine[.@i]+","+ getd(".@cards_"+.@i+"_0") +","+ getd(".@cards_"+.@i+"_1") +","+ getd(".@cards_"+.@i+"_2") +","+ getd(".@cards_"+.@i+"_3") +","+ .@ticket_id +")";
                }
            }
        case 2:
            close;
        case 1:
            next;
            mes "[ Item Redeem ]";
            mes "Are you sure you want to claim the items?";
            select("Yes, Claim the Items");
            next;
            mes "[ Item Redeem ]";
            query_sql "SELECT `id`,`item_id`,`amount`,`refine`,`card0`,`card1`,`card2`,`card3` FROM `ir_main` WHERE `claim`=0 AND `account_id`="+ getcharid(3),.@id,.@item_id,.@amount,.@refine,.@card0,.@card1,.@card2,.@card3;
            .@count = getarraysize(.@id);
            if (.@count == 0){
                mes "You don't have any items to redeem..";
                close;
            }
            mes "Are you Sure you want to redeem these items?";
            mes "Items List: ";
            for (.@i = 0; .@i < .@count; .@i++) {
                mes (.@i+1)+".) "+ .@amount[.@i]+"x "+ getitemname(.@item_id[.@i]);
                if (.@refine[.@i])
                    mes "Refine: "+ .@refine[.@i];
                if (.@card0[.@i] || .@card1[.@i] || .@card2[.@i] || .@card3[.@i])
                    mes "Cards: ";
                    for (.@j = 0; .@j < 4; .@j++)
                        if (getd(".@card"+.@j+"["+.@i+"]"))
                            mes (.@j+1)+" Slot: "+ getitemname(getd(".@card"+.@j+"["+.@i+"]"));
            }
            if (select("Yes, Redeem:No, Don't Redeem Now...") == 2){
                next;
                mes "[ Item Redeem ]";
                mes "Okay, Come back soon to redeem it...";
                close;
            }
            next;
            mes "[ Item Redeem ]";
            for (.@i = 0; .@i < .@count; .@i++) {
                if (checkweight(.@item_id[.@i],.@amount[.@i])){
                    query_sql "UPDATE `ir_main` SET `claim`="+getcharid(3)+" WHERE `id`="+.@id[.@i];
                    getitem2 .@item_id[.@i],.@amount[.@i],1,.@refine[.@i],0,.@card0[.@i],.@card1[.@i],.@card2[.@i],.@card3[.@i];
                } else {
                    mes "You are OverWeight....";
                    mes "Please Empty some weight, to get more items...";
                    close;
                }
            }
            mes "All Items have been redeemed...";
            close;
    }
    end;
OnInit:
    query_sql "CREATE TABLE IF NOT EXISTS `ir_main` (  `id` bigint(20) unsigned NOT NULL auto_increment,  `account_id` int(11) unsigned NOT NULL,  `item_id` int(11) unsigned NOT NULL,  `amount` int(11) unsigned NOT NULL,  `refine` tinyint(3) unsigned NOT NULL default '0',  `card0` smallint(5) unsigned NOT NULL default '0',  `card1` smallint(5) unsigned NOT NULL default '0',  `card2` smallint(5) unsigned NOT NULL default '0',  `card3` smallint(5) unsigned NOT NULL default '0',  `ticket_id` int(11) unsigned NOT NULL default '0',  `claim` tinyint(2) NOT NULL DEFAULT '0', PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1";
    end;
}
Viewed 924 times, submitted by Guest.