viewing paste Unknown #11174 | 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 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 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480
morocc,81,103,4 script  Bree    555,{
function a; function b;
    
    goto MainMenu;
    MainMenu:                                                           
        mes .npc$;
        mes "Greetings "+strcharinfo(0)+"!";
        mes "I am the known ^00557fGift Package Wrapper^000000.";
        next;
        if(getgmlevel()>=.@gm) { 
            menu "[ ^005500Information^000000 ]",Info,"[ ^00007fWrap a Gift^000000 ]",Wrap,"[ ^ff0000GM Menu^000000 ]",GMMenu; 
        }
        else {
            menu "[ ^005500Information^000000 ]",Info,"[ ^00007fWrap a Gift^000000 ]",Wrap;
        }
        close;
    GMMenu:
        mes .npc$;
        mes "Please select an option.";
        next;
        menu "[ ^005500Gift Listing^000000 ]",GiftList,"[ ^00007fDelete a Gift^000000 ]",DeleteGift,"[ ^ff0000Main Menu^000000 ]",MainMenu;
        close;
    GiftList:
        set .@serials,query_sql("SELECT `serial`,`sender`,`time_created`,`item_id`,`refine`,`card1`,`card2`,`card3`,`card4` FROM `ragnarok`.`gift_sys` ORDER BY `time_created` ASC LIMIT 15",.@ser$,.@sen$,.@time$,.@a,.@b,.@c,.@d,.@e,.@f);
        mes "[ ^00007fGift Box Listing^000000 ]";
        if ( !.@serials ) {
            mes "^ff0000No Gift Box existed.^000000";
            next;
            menu "[ ^00007fDelete a Gift^000000 ]",DeleteGift,"[ ^ff0000GM Menu^000000 ]",GMMenu,"[ ^00007fClose^000000 ]",No;
            close;
        }
        dispbottom "#:Serial:Sender:Time Created:Item:Refine:Card1:Card2:Card3:Card4";
        mes "^ff0000See Chat-Box below to see Gift Listing.^000000";    
        for(set .@i,0; .@i<getarraysize(.@serials); set .@i,.@i+1){
            dispbottom .@i+"."+.@ser$[.@i]+":"+.@sen$[.@i]+":"+.@time$[.@i]+":"+getitemname(.@a[.@i])+":"+.@b[.@i]+":"+getitemname(.@c[.@i])+":"+getitemname(.@d[.@i])+":"+getitemname(.@e[.@i])+":"+getitemname(.@f[.@i])+"";
        }
        next;
        menu "[ ^005500Return^000000 ]",GMMenu,"[ ^00007fClose^000000 ]",No;
        close;
    DeleteGift:
        set .@serials,query_sql("SELECT `serial`,`sender`,`time_created` FROM `ragnarok`.`gift_sys` ORDER BY `time_created` ASC LIMIT 15",.@ser$,.@sen$,.@time$);
        mes "[ ^00007fDelete a Gift^000000 ]";
        if(!.@serials) {
            mes "^ff0000No Gift Box existed.^000000";
            next;
            menu "[ ^00007fDelete a Gift^000000 ]",DeleteGift,"[ ^ff0000GM Menu^000000 ]",GMMenu,"[ ^00007fClose^000000 ]",No;
            close;
        }
        mes "^ff0000See Chat-Box below to see Gift Listing.^000000";
        dispbottom "Existing Gift Box Serials:";    
        dispbottom "#:Serial:Sender:Time Created";
        for(set .@i,0; .@i<getarraysize(.@serials); set .@i,.@i+1){
            dispbottom .@i+"."+.@ser$[.@i]+":"+.@sen$[.@i]+":"+.@time$[.@i]+"";
        }
        mes "Input Serial to delete a Gift.";
        input .@sn$;
        if(.@ser$!=.@sn$){
            next;
            mes "[ ^00007fDelete a Gift^000000 ]";
            mes "Serial doesn`t exist.";
            next;
            menu "[ ^00007fDelete a Gift^000000 ]",DeleteGift,"[ ^ff0000GM Menu^000000 ]",GMMenu,"[ ^00007fClose^000000 ]",No;
            close;
        }
        mes "Serial : [ ^ff0000"+.@sn$+"^000000 ]";
        mes "^005500Proceed to delete.^000000";
        next;
        mes "[ ^00007fDelete a Gift^000000 ]";
        mes "Deleting...";
        sleep2 500;
        mes ".....";
        sleep2 500;
        mes "........";
        mes "^ff0000Gift Box deleted.^000000";
        query_sql "DELETE FROM `gift_sys` WHERE `serial` = '"+escape_sql(.@sn$)+"'";
        query_sql "DELETE FROM `gift_box` WHERE `serial` = '"+escape_sql(.@sn$)+"'";
        next;
        menu "[ ^00007fDelete a Gift^000000 ]",DeleteGift,"[ ^ff0000GM Menu^000000 ]",GMMenu,"[ ^00007fClose^000000 ]",No;
        close;
    Info:
        mes .npc$;
        mes "I can wrap any [ ^005500Items^000000 ] or";  
        mes "[ ^005500Equipments^000000 ] you are wearing into a [ ^ff0000Gift Package ^000000].";
        next;
        mes .npc$;
        mes "Before I wrap the [ ^55007fGift Package^000000 ]. First you need to"; 
        mes "[ ^005500Write a Message^000000 ] to the gift";
        mes "[ ^ff0000Reciever^000000 ].";
        next;
        mes .npc$;
        mes "Next we need to put a [ ^ff0000Serial^000000 ] that will be provided by you, in the package so that no one can open the box except your desired reciever.";
        next;
        if(.toggle[0]==1) {
            mes .npc$;
            mes "I need these [ ^ff0000Materials^000000 ] to start wrapping the Gift Package.";
            for(set .@a,1; .@a<getarraysize(.req); set .@a,.@a+1){
                mes .@a+".[ ^00007f"+b(.req[.@a])+"^000000 : ^0055ff"+.amt[.@a]+"^000000 ]";
                }
            next;
        }
        if(.toggle[1]==1) {
            mes .npc$;
            mes "Also theres a fee for packaging service. The cost is";
            mes "[ ^ff0000"+.toggle[2]+"^000000 ] Zeny.";
            next;
        }
        mes .npc$;
        mes "When [ ^007979Claiming^000000 ] the Gift Package";
        mes "use [ ^ff0000@gift^000000 ] and enter the right"; 
        mes "[ ^005500Serial Key^000000 ] and [ ^00007fName^000000 ] of the sender.";
        next;
        mes .npc$;
        mes "You cannot use [ ^ff0000@gift^000000 ] command when you don`t have any [ ^00007fGift Package^000000 ] in your [ ^005500Inventory^000000 ].";
        next;
        mes .npc$;
        mes "Remember that only [ ^ff0000ONE^000000 ] Gift is allowed that can be stored in your [ ^005500Inventory^000000 ]. Resulting of [ ^00007fTwo or More Count^000000 ] will"; 
        mes "[ ^ff0000Drop any Gift^000000 ] beside the first one. Just to be [ ^55aaffSafe^000000 ] you can put other gifts to your [ ^e69900Storage^000000 ] and claim it [ ^005500One by One^000000 ].";
        next;
        mes .npc$;
        mes "Well thats all, its very simple, isn`t it?";
        emotion e_no1;
        next;
        menu "[ ^009e00Return^000000 ]",MainMenu,"[ ^ff0000Done^000000 ]",No;
        close;
    Wrap:
        mes .npc$;
        mes "^ff0000Remember that any equip attribute that will be wrapped as gift will be deleted.^000000";
        next;
        mes .npc$;
        mes "^ff0000You cannot create two gift using one name, the reciepient must claim the gift first for you to be able to make another gift.^000000";
        next;
        mes .npc$;
        mes "^ff0000Also you cannot change any equipment you are wearing while im doing the job. If you do that, I will discontinue the wrapping.^000000";
        next;
        menu "[ ^005500Proceed^000000 ]",Yes,"[ ^00557fCancel^000000 ]",No; 
        close;
    No: 
        mes .npc$;
        mes " ";
        mes "Have a nice day!";
        close;
    Yes:
        mes .npc$;
        mes "^ff0000Checking inventory..^000000";
        mes "....";
        sleep2 500;
        mes "^005500Please wait a moment...^000000";
        sleep2 500;
        if(getequipisequiped(1)==0&&getequipisequiped(2)==0&&getequipisequiped(3)==0&&getequipisequiped(4)==0&&getequipisequiped(5)==0&&getequipisequiped(6)==0&&getequipisequiped(7)==0&&getequipisequiped(8)==0&&getequipisequiped(9)==0&&getequipisequiped(10)==0){
            mes "....";
            sleep2 500;
            mes "^4f4f4fYou are not equipping any item!^000000";
            next;
            menu "[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;
            close;
        }
        else {          
            mes "....";
            sleep2 500;
            mes "^ff0000Done!^000000";
            next;   
        }
        if(.toggle[0]==1) {
            mes .npc$;
            mes "Requirements:";
            for(set .@a,1; .@a<getarraysize(.req); set .@a,.@a+1){
                mes .@a+".[ ^00007f"+b(.req[.@a])+"^000000 : ^0055ff"+.amt[.@a]+"^000000 ]";
                }
        }
        if(.toggle[1]==1) {
            mes "Zeny Cost : [ ^a87000"+.toggle[2]+"^000000 ]";
        }
        if(.toggle[0]==1) {
            for(set .@b,1; .@b<getarraysize(.req); set .@b,.@b+1){
                if(countitem(.req[.@b])<.amt[.@b]) {
                    next;
                    mes .npc$;
                    mes " ";
                    mes "^3b3b3bYou are lacking of requirements!^000000";
                    next;
                    menu "[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;
                    close;
                }
            }
        }
        if(.toggle[1]==1) {
            if(Zeny<.toggle[2]) {
                next;
                mes .npc$;
                mes "^3b3b3bYour Zeny is insufficient^000000.";
                next;
                menu "[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;
                close;
            }
        }
        mes .npc$;
        mes "^abab00Select the equipment that will be wrapped.^000000";
        set .@m,select(a(1),a(2),a(3),a(4),a(5),a(6),a(7),a(8),a(9),a(10));
        for(set .@a,0; .@a<getarraysize(.p); set .@a,.@a+1){
            if(.@m==.p[.@a]&&getequipname(.p[.@a])=="") {
            mes " ";
            mes "There are no equipment in that slot.";
            next;
            menu "[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;
            close;
            }
        }
        set .@gi,getequipid(.@m);
        set .@gr,getequiprefinerycnt(.@m);
        set .@ga,getequipcardid(.@m,0);
        set .@gb,getequipcardid(.@m,1);
        set .@gd,getequipcardid(.@m,2);
        set .@gc,getequipcardid(.@m,3);
        next;
        if (getequipid(.@m) != .@gi) {
            mes .npc$;
            mes "Aha! You switched your equipment! You dont do that to me!";
            close;
        }
        if (countitem(.@gi) > 1) {
            mes .npc$; 
            mes " ";
            mes "^3b3b3bLooks like you have same equipment in your inventory, store it first.^000000"; 
            close;
        }
        if(getequipisequiped(1)==0&&getequipisequiped(2)==0&&getequipisequiped(3)==0&&getequipisequiped(4)==0&&getequipisequiped(5)==0&&getequipisequiped(6)==0&&getequipisequiped(7)==0&&getequipisequiped(8)==0&&getequipisequiped(9)==0&&getequipisequiped(10)==0){
            mes "....";
            sleep2 500;
            mes "^4f4f4fYou are not equipping any item!^000000";
            close;
        }
        mes .npc$;
        mes "Input the reciever`s name.";
        input .@reciever$;
        mes "[ Name ] : ^55007f"+.@reciever$+"^000000";
        if(getstrlen(.@reciever$)<4||getstrlen(.@reciever$)>23){
            next;
            mes .npc$;
            mes " ";
            mes "^3b3b3bName must be atleast 4 character lenght and maximum of 23.^000000";
            next;
            menu "[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;
            close;
        }
        if(.@reciever$ == strcharinfo(0)){
            next;
            mes .npc$;
            mes " ";
            mes "^3b3b3bYou cannot put your own name!^000000";
            next;
            menu "[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;
            close;
        }
        next;
        if (getequipid(.@m) != .@gi) {
            mes .npc$;
            mes "Aha! You switched your equipment! You dont do that to me!";
            close;
        } 
        mes .npc$;
        mes "Now type your message.";
        input .@rm$;
        if(getstrlen(.@rm$)<4||getstrlen(.@rm$)>23){
            next;
            mes .npc$;
            mes " ";
            mes "^3b3b3bMessage must be atleast 4 character lenght and maximum of 23.^000000";
            next;
            menu "[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;
            close;
        }
        mes "[ Message ] :";
        mes "^00007f"+.@rm$+"^000000";
        next;
        if (getequipid(.@m) != .@gi) {
            mes .npc$;
            mes "Aha! You switched your equipment! You dont do that to me!";
            close;
        }
        mes .npc$;
        mes "Input your desired serial.";
        input .@h$;
        mes "[ Serial ] :"; 
        mes "^339a9a"+.@h$+"^000000 ";
        query_sql "SELECT `serial`,`sender`,`account_id` FROM `ragnarok`.`gift_sys` WHERE `serial` = '"+escape_sql(.@h$)+"'",.@s$,.@g$,.@i;
        query_sql "SELECT `sender` FROM `ragnarok`.`gift_box` WHERE `serial` = '"+escape_sql(.@h$)+"'",.@n$;
        if(getstrlen(.@h$)<4||getstrlen(.@h$)>10){
            next;
            mes .npc$;
            mes " ";
            mes "^3b3b3bSerial must be atleast 4 character length and maximum of 10.^000000";
            next;
            menu "[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;
            close;
        }
        if(strcharinfo(0) == .@h$) {
            mes .npc$;
            mes " ";
            mes "^3b3b3bYou cannot enter your name as serial.^000000";
            next;
            menu "[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;
        }
        if(strcharinfo(0) == .@g$ || getcharid(3) == .@i){
            next;
            mes .npc$;
            mes " ";
            mes "^3b3b3bYour gift is not opened yet, cannot create another one^000000.";
            close;
        }
        if(.@s$ == .@h$){
            next;
            mes .npc$;
            mes " ";
            mes "^3b3b3bYou cannot enter this serial.^000000";
            next;
            menu "[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;
            close;
        }
        if (getequipid(.@m) != .@gi || (getequiprefinerycnt(.@m) != .@gr)) {
            next;
            mes .npc$;
            mes " ";
            mes "^3b3b3bYou changed your equipment.^000000";
            close;
        }
        if(getequipisequiped(1)==0&&getequipisequiped(2)==0&&getequipisequiped(3)==0&&getequipisequiped(4)==0&&getequipisequiped(5)==0&&getequipisequiped(6)==0&&getequipisequiped(7)==0&&getequipisequiped(8)==0&&getequipisequiped(9)==0&&getequipisequiped(10)==0){
            mes "....";
            sleep2 500;
            mes "^4f4f4fYou are not equipping any item!^000000";
            next;
            menu "[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;
            close;
        }
        if(.toggle[0]==1) {
            for(set .@b,1; .@b<getarraysize(.req); set .@b,.@b+1){
                if(countitem(.req[.@b])<.amt[.@b]) {
                    next;
                    mes .npc$;
                    mes " ";
                    mes "^3b3b3bYou are lacking of requirements!^000000";
                    next;
                    menu "[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;
                    close;
                }
            }
        }
        if(.toggle[1]==1) {
            if(Zeny<.toggle[2]) {
                next;
                mes .npc$;
                mes " ";
                mes "^3b3b3bYour Zeny is insufficient^000000.";
                next;
                menu "[ ^005500Return^000000 ]",Yes,"[ ^ff0000Cancel^000000 ]",No;
                close;
            }
        }
        progressbar "ffff00",3;
        if (getequipid(.@m) != .@gi) {
            mes .npc$;
            mes "Aha! You switched your equipment! You dont do that to me!";
            close;
        }
        unequip .@m;
        delitem .@gi,1;
        emotion e_proud;
        emotion e_lv2,1;
        set .@charid,getcharid(0,""+strcharinfo(0)+"");
        set .@card3, .@charid & 65535;
        set .@card4, .@charid >> 16;
        set .@aid,getcharid(3);
        next;
        mes .npc$;
        mes " ";
        mes "^005500Done wraping the gift!^000000";
        getitem2 .gb,1,1,0,0,254,0,.@card3,.@card4,.@aid;
        if(.toggle[1]==1) {
            set Zeny,Zeny-.toggle[2];
        }
        if(.toggle[0]==1) {
            for(set .@b,1; .@b<getarraysize(.req); set .@b,.@b+1){
                delitem .req[.@b],.amt[.@b];
            }
        }
        query_sql "INSERT INTO `ragnarok`.`gift_box` (`serial`,`sender`,`account_id`,`time_created`,`reciever`,`message`,`item_id`,`card1`,`card3`,`card4`) VALUES ('"+escape_sql(.@h$)+"','"+strcharinfo(0)+"','"+getcharid(3)+"',NOW(),'"+escape_sql(.@reciever$)+"','"+escape_sql(.@rm$)+"','"+escape_sql(.gb)+"','254','"+escape_sql(.@card3)+"','"+escape_sql(.@card4)+"')";
        query_sql "INSERT INTO `ragnarok`.`gift_sys` (`serial`,`sender`,`account_id`,`time_created`,`item_id`,`refine`,`card1`,`card2`,`card3`,`card4`) VALUES ('"+escape_sql(.@h$)+"','"+strcharinfo(0)+"','"+getcharid(3)+"',NOW(),'"+escape_sql(.@gi)+"','"+escape_sql(.@gr)+"','"+escape_sql(.@ga)+"','"+escape_sql(.@gb)+"','"+escape_sql(.@gc)+"','"+escape_sql(.@gd)+"')";
        close
    
function    b   { 
    return ""+getitemname(getarg(0))+""; 
}
function    a   { 
    if(getequipname(getarg(0,0))=="") 
    return "-  ^ff0000Empty^000000  -"; 
    return ""+getequipname(getarg(0))+""; 
}
//----------------------MODIFY SETUP TO YOUR OWN LIKING-----------------------------------------
OnInit:
    set .npc$,"[ ^00007fBree^000000 ]"; // NPC Name
    setarray .toggle[0],1// 1 Enable & 0 Disable requirements.
                        1// 1 Enable & 0 Disable wrapping cost in Zeny.
                5000000;    // Wrapping cost in Zeny.
    setarray .req[1],501,   // Requirement 1 id number.
                  502,      // Requirement 2 id number.
                  503,      // Requirement 3 id number.
                  504,      // Requirement 4 id number.
                  505;      // Requirement 5 id number.
    setarray .amt[1],1,     // Requirement 1 amount.
                  2,        // Requirement 2 amount.
                  3,        // Requirement 3 amount.
                  4,        // Requirement 4 amount.
                  5;        // Requirement 5 amount.
    set .gb,21020;          // Gift Box ID
    set .@gm,99;            // GM Level for GM menu view.
    setarray .gmaid[0],2000000,     // ADD GM Account ID here. 
                     2000001;       // Auto delete @atcommand of players.
//----------------------DONT CHANGE ANYTHING BEYOND THIS POINT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------DONT CHANGE ANYTHING BEYOND THIS POINT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------DONT CHANGE ANYTHING BEYOND THIS POINT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------DONT CHANGE ANYTHING BEYOND THIS POINT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------DONT CHANGE ANYTHING BEYOND THIS POINT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
    setarray .p[0],1,2,3,4,5,6,7,8,9,10;
    query_sql "CREATE TABLE IF NOT EXISTS `ragnarok`.`gift_sys` (`serial` varchar(10) NOT NULL DEFAULT '',`sender` varchar(26) NOT NULL DEFAULT '',`account_id` int(11) unsigned NOT NULL default '0',`time_created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',`item_id` INT( 6 ) NOT NULL DEFAULT '0',`refine` INT( 2 ) NOT NULL DEFAULT '0',`card1` INT( 6 ) NOT NULL DEFAULT '0',`card2` INT( 6 ) NOT NULL DEFAULT '0',`card3` INT( 6 ) NOT NULL DEFAULT '0',`card4` INT( 6 ) NOT NULL DEFAULT '0', PRIMARY KEY (`serial`)) ENGINE = MYISAM COMMENT = 'Lil-Troll:Best Regards!'"; 
    query_sql "CREATE TABLE IF NOT EXISTS `ragnarok`.`gift_box` (`serial` varchar(10) NOT NULL DEFAULT '',`sender` varchar(26) NOT NULL DEFAULT '',`account_id` int(11) unsigned NOT NULL default '0',`time_created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',`reciever` varchar(25) NOT NULL DEFAULT '',`message` varchar(25) NOT NULL DEFAULT '',`item_id` INT( 6 ) NOT NULL DEFAULT '0',`card1` INT( 6 ) NOT NULL DEFAULT '0',`card3` INT( 6 ) NOT NULL DEFAULT '0',`card4` INT( 6 ) NOT NULL DEFAULT '0', PRIMARY KEY (`serial`)) ENGINE = MYISAM COMMENT = 'Lil-Troll:Best Regards!'"; 
    bindatcmd "gift", strnpcinfo(3)+ "::OnGift"; 
    bindatcmd "GIFT", strnpcinfo(3)+ "::OnGift"; 
    bindatcmd "Gift", strnpcinfo(3)+ "::OnGift";
    waitingroom "Gift Wrapper",0;
end;
OnGift:
    if(countitem(.gb)<1){
        dispbottom "No gift box in your inventory.";
        end;
    }
    mes "[ ^ff0000Gift Box^000000 ]";
    mes "^005500Input Serial:^000000";
    input .@g$;
    query_sql "SELECT `sender`,`item_id`,`account_id`,`refine`,`card1`,`card2`,`card3`,`card4` FROM `ragnarok`.`gift_sys` WHERE `serial` = '"+escape_sql(.@g$)+"'",.@b$,.@c,.@a,.@d,.@e,.@f,.@g,.@h;
    query_sql "SELECT `sender`,`reciever`,`message`,`account_id`,`item_id`,`card1`,`card3`,`card4` FROM `ragnarok`.`gift_box` WHERE `serial` = '"+escape_sql(.@g$)+"'",.@nm$,.@rm$,.@mm$,.@aa,.@bb,.@cc,.@dd,.@ee;
    if ( !.@c ) {
        mes "^3b3b3bWrong serial or non-existing.^000000";
        close;
    }
    mes "SN: ^00007f"+.@g$+"^000000";
    mes "^55007fEnter the name of the Sender:^000000";
    input .@n$;
    if ( .@n$ != .@b$ ) {
        mes "^^3b3b3bWrong sender's name(Case Sensitive)!^000000";
        close;
    }
    mes "Sender: ^ad7300"+.@n$+"^000000";
    mes "^00afafOpening the gift!^000000";
    next;
    mes "[ ^ff0000Gift Box^000000 ]";
    mes "From : ^ff0000"+.@nm$+"^000000";
    mes "Dear : ^0000ff"+.@rm$+"^000000";
    mes ""+.@mm$+"";
    progressbar "ffff00",3;
    close2;
    dispbottom "[ ^ff0000Gift Box^000000 ]";
    dispbottom "From : ^ff0000"+.@nm$+"^000000";
    dispbottom "Dear : ^0000ff"+.@rm$+"^000000";
    dispbottom ""+.@mm$+"";
    getitem2 .@c,1,1,.@d,0,.@e,.@f,.@g,.@h,.@a;
    delitem2 .@bb,1,1,0,0,.@cc,0,.@dd,.@ee,.@aa;
    query_sql "DELETE FROM `gift_sys` WHERE `serial` = '"+escape_sql(.@g$)+"'";
    query_sql "DELETE FROM `gift_box` WHERE `serial` = '"+escape_sql(.@g$)+"'";
    specialeffect2 509; specialeffect2 709; sleep2 1000;
    specialeffect2 509; specialeffect2 709; sleep2 1000;
    specialeffect2 509; specialeffect2 709; sleep2 1000;
    specialeffect2 509; specialeffect2 709; sleep2 1000;
    specialeffect2 509; specialeffect2 709;
    end;    // ENDS : Claim Gift
}   // ENDS : Gift Packager NPC
//----------------------DONT CHANGE ANYTHING ABOVE THIS POINT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------DONT CHANGE ANYTHING ABOVE THIS POINT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------DONT CHANGE ANYTHING ABOVE THIS POINT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------DONT CHANGE ANYTHING ABOVE THIS POINT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------DONT CHANGE ANYTHING ABOVE THIS POINT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Viewed 1050 times, submitted by Guest.