viewing paste Unknown #16053 | 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 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 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975
 
maintown,180,45,3   script  Hollengrhen 85,{
    callfunc "refinemain","Hollengrhen",1;
    end;
}
//============================================================
//= Main Refiner Function
//============================================================
//= To allow auto safe refining/multiple refining set the
//= second argument to '1' in the function call.
//============================================================
function    script  refinemain  {
    set .@features,getarg(1);
    mes "[" + getarg(0) + "]";
    mes "I'm the Armsmith.";
    mes "I can refine all kinds of weapons, armor and equipment, so let me";
    mes "know what you want me to refine.";
    next;
 
    setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
    set .@menu$,"";
    for( set .@i,1; .@i <= 10; set .@i,.@i+1 )
    {
        if( getequipisequiped(.@i) )
            set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
 
        set .@menu$, .@menu$ + ":";
    }
    if (!M_quickref)
        set .@menu$, .@menu$ + "^0000FFTurn ^009933ON^0000FF Quick Refining^000000";
    else
        set .@menu$, .@menu$ + "^0000FFTurn ^FF0000OFF^0000FF Quick Refining^000000";
    set .@part,select(.@menu$);
    if (.@part == .@i ) {
        mes "[" + getarg(0) + "]";
        if (!M_quickref) {
            mes "The ^0000FFQuick Refine^000000 Function has been Turned ^009933ON^000000";
            set M_quickref, 1;
        }
        else {
            mes "The ^0000FFQuick Refine^000000 Function has been Turned ^FF0000OFF^000000";
            set M_quickref, 0;
        }
        close;
    }
    if(!getequipisequiped(.@part)) {
        mes "[" + getarg(0) + "]";
        mes "You're not wearing";
        mes "anything there that";
        mes "I can refine.";
        emotion 6;
        close;
    }
    //Check if the item is refinable...
    if(!getequipisenableref(.@part)) {
        mes "[" + getarg(0) + "]";
        mes "I don't think I can";
        mes "refine this item at all...";
        close;
    }
    //Check if the item is identified... (Don't know why this is in here... but kept it anyway)
    if(!getequipisidentify(.@part)) {
        mes "[" + getarg(0) + "]";
        mes "You can't refine this";
        mes "if you haven't appraised";
        mes "it first. Make sure your";
        mes "stuff is identified before";
        mes "I can refine it.";
        close;
    }
    //Check to see if the items is already +10
    if(getequiprefinerycnt(.@part) >= 10) {
        mes "[" + getarg(0) + "]";
        mes "I can't refine this";
        mes "any more. This is as";
        mes "refined as it gets!";
        close;
    }
    set .@refineitemid, getequipid(.@part); // save id of the item
    set .@refinerycnt, getequiprefinerycnt(.@part); //save refinery count
    switch(getequipweaponlv(.@part)){
    
    // ----------- Refine Prices, Materials and Safe Refines ---------- //
    
    case 0:     //Refine Armor
        set .@price,2000;
        set .@material,985;
        set .@safe,4;
        break;
    case 1:     //Refine Level 1 Weapon
        set .@price,50;
        set .@material,1010;
        set .@safe,7; 
        break;
    case 2:     //Refine Level 2 Weapon
        set .@price,200;
        set .@material,1011;
        set .@safe,6; 
        break;
    case 3:     //Refine Level 3 Weapon
        set .@price,5000;
        set .@material,984;
        set .@safe,5; 
        break;
    case 4:     //Refine Level 4 Weapon
        set .@price,20000;
        set .@material,984;
        set .@safe,4; 
        break;
    case 5:     //Refine other stuff?
        set .@price,2000;
        set .@material,985;
        set .@safe,4; 
        break;
        
    // ----------------------------------------------------------------- //
        
    }
    if(.@features != 1) {
        mes "[" + getarg(0) + "]";
        mes "To refine this I need";
        mes "one ^003366"+getitemname(.@material)+"^000000 and";
        mes "a service fee of " + .@price + " Zeny.";
        mes "Do you really wish to continue?";
        next;
        if(select("Yes:No") == 2){
            mes "[" + getarg(0) + "]";
            mes "Yeah...";
            mes "There's no need to";
            mes "rush. Take your time.";
            close;
        }
        if(getequippercentrefinery(.@part) < 100) {
            mes "[" + getarg(0) + "]";
            mes "Oh no! If I continue to";
            mes "refine this, there's a risk it could";
            switch(.@material) {
            case 985:
                mes "be destroyed! That means that ^FF0000this equipment^000000, and ^FF0000any cards^000000 or special properties added to this armor, ^FF0000will be gone^000000.";
                break;
            default:
                mes "be destroyed, and you'd ^FF0000lose the weapon^000000, any ^FF0000cards in the weapon^000000,";
                mes "or any added special properties.";
                break;
            }
            next;
            mes "["+getarg(0)+"]";
            mes "I can't make it any clearer.";
            mes "Once a weapon is destroyed,";  
            mes "there's no getting it back.";
            mes "You really have a chance to";
            mes "^FF0000lose this weapon^000000 forever.";
            mes "Do you still want to refine?";
            next;
            if(select("Yes:No") == 2){
                mes "[" + getarg(0) + "]";
                mes "I completely agree...";
                mes "I might be a great refiner, but sometimes even I make mistakes.";
                close;
            }
        }
        if((countitem(.@material) < 1) || (Zeny < .@price)) {
            mes "[" + getarg(0) + "]";
            mes "You don't seem to have";
            mes "enough Zeny or "+getitemname(.@material)+"...";
            mes "Go get some more. I'll be";
            mes "here all day if you need me.";
            close;
        }
        set Zeny,Zeny-.@price;
        delitem .@material,1;
        if(getequipisequiped(.@part) == 0) { // hacker has removed the item (not changed, why?)
            mes "[" + getarg(0) + "]";
            mes "Look here... you don't have any Items on...";
            close;
        }
        if(getequiprefinerycnt(.@part) != .@refinerycnt || getequipid(.@part) != .@refineitemid) { // hacker has changed the item
            next;
            mes "[" + getarg(0) + "]";
            mes "You changed your equipment!";
            mes "You filthy scum!!!";
            next;
            atcommand "@nuke "+strcharinfo(0);
            end;
        }
        if(getequippercentrefinery(.@part) <= rand(100)) {
            failedrefitem .@part;
            mes "[" + getarg(0) + "]";
            set .@emo,rand(1,5);
            if (.@emo == 1) {
                emotion e_cash;
            } else {
                emotion e_swt;
            }
            set .@lose,rand(1,3);
            if (.@lose == 1) {
                mes "OH! MY GOD!";
                mes "Damn it! Not again!";
                mes "I'm terribly sorry, but you know practice does make perfect.";
                mes "Um, right? Heh heh...";
            } else if(.@lose == 2) {
                mes "Nooooooo!";
                mes "It broke!";
                mes "I-I'm sorry!";
            } else {
                mes "Crap!";
                mes "It couldn't take";
                mes "much more tempering!";
                mes "Sorry about this...";
            }
            close;
        }
        mes "["+getarg(0)+"]";
        successrefitem .@part;
        emotion e_heh;
        set .@win,rand(1,3);
        if (.@win == 1) {
            mes "Perfect!";
            mes "Heh heh!";
            mes "Once again,";
            mes "flawless work";
            mes "from the master~";
        } else if(.@win == 2) {
            mes "Success...!";
            mes "Yet again, my amazing";
            mes "talent truly dazzles";
            mes "and shines today.";
        } else {
            mes "Heh heh!";
            mes "I'm all done.";
            mes "No doubt, my work is";
            mes "to your satisfaction.";
            mes "Sheer, utter perfection~";
        }
        close;
    }
 
// New Refining Functions ========================
    if(getequiprefinerycnt(.@part) < .@safe) {
        mes "[" + getarg(0) + "]";
        mes "Alright, would you like to refine to safe limit, or pick a number of refines?";
        next;
        set .@menu2,select("Safe Limit:Choose Number:Nevermind");
    }
    else set .@menu2, 2;
    switch(.@menu2){
    case 1: 
        mes "["+strnpcinfo(1)+"]";
        mes "Alright, I can do that for ALL ^0000FF"+getequipname(.@part)+"^000000 you have in your inventory, or just the one currently equipped.";
        next;
        if (select ("Currently Equipped:All Items in Inventory") == 2) set .@allinv, 1;
        set .@refinecnt,.@safe - getequiprefinerycnt(.@part);
        break;
        
    case 2:
        next;
        mes "[" + getarg(0) + "]";
        mes "So how many times would you like me to refine your item?";
        next;
        input .@refinecnt;
        set .@refinecheck,.@refinecnt + getequiprefinerycnt(.@part);
        if (.@refinecnt < 1 || .@refinecheck > 10) {
            mes "[" + getarg(0) + "]";
            mes "I can't refine this item that many times.";
            close;
        }
        mes "["+strnpcinfo(1)+"]";
        mes "Alright, I can do it for only your currently equipped item, or ALL ^0000FF"+getequipname(.@part)+"^000000 you have in your inventory. What would you like to do?";
        next;
        if (select ("Currently Equipped:All Items in Inventory") == 2) set .@allinv, 1;
        if (.@allinv)
            set .@refinecnt, getequiprefinerycnt(.@part) + .@refinecnt;
        if ( (!.@allinv) && (.@refinecheck < .@safe) )
            break;
        mes "[" + getarg(0) + "]";
        if ( !.@allinv)
            mes "This will try to refine the equipment " + (.@refinecheck - .@safe) + " times past the safe limit. Your equipment may be destroyed... is that ok?";
        else
            mes "Remember this will attempt to refine to ^009933+"+.@refinecnt+"^000000 ^FF0000ALL^000000 the ^0000FF"+getequipname(.@part)+"^000000 items you have in your inventory!!";
        next;
        if(select("Accept","Reject") == 2){
            mes "[" + getarg(0) + "]";
            mes "Smart kid....";
            close;
        }
        break;
        
    case 3:
        next;
        mes "[" + getarg(0) + "]";
        mes "You said so..Hmm so be it...";
        close;
        
    }
    if (.@allinv) {
        deletearray @inventorylist_refine;
        deletearray @inventorylist_id;
        getinventorylist;
        set .@i, 0;
        for (set .@j, 0; .@j < @inventorylist_count; set .@j, .@j + 1) {
            if ( @inventorylist_id[.@j] == getequipid(.@part) ) {
                set .@temp[.@i], @inventorylist_refine[.@j];
                set .@i, .@i + 1;
            }
        }
        deletearray @inventorylist_refine;
        deletearray @inventorylist_id;
    }
    set .@fullprice, 0;
    if ( !.@allinv )
        set .@fullprice,.@price * .@refinecnt;
    else {
        set .@j, 0;
        for ( set .@k, 0; .@k < .@i ; set .@k, .@k + 1) {
            if ( .@temp[.@k] < .@refinecnt ) {
                set .@fullprice, .@fullprice + ( ( .@refinecnt - .@temp[.@k] ) * .@price );
                set .@j, .@j + (.@refinecnt - .@temp[.@k]);
            }
        }
        deletearray .@temp;
    }
    mes "[" + getarg(0) + "]";
    if ( !.@allinv )
        mes "That will cost you " + .@refinecnt + " " + getitemname(.@material) + " and " + .@fullprice + " Zeny. Is that ok?";
    else
        mes "That will cost you " + .@j + " " + getitemname(.@material) + " and " + .@fullprice + " Zeny. Is that ok?";
    next;
    if(select("Yes","No...") == 2){
        mes "[" + getarg(0) + "]";
        mes "You said so..Hmm so be it...";
        close;
    }
        
    if ( !.@allinv ) {
        if(countitem(.@material) < .@refinecnt || Zeny < .@fullprice) {
            mes "[" + getarg(0) + "]";
            mes "Is that all you got? Unfortunately I can't work for you at a lower price. Try putting yourself in my shoes.";
            close;
        }
        set Zeny,Zeny - .@fullprice;
        delitem .@material,.@refinecnt;
        while(.@refinecnt){
            if (getequipisequiped(.@part) == 0) {
                mes "[" + getarg(0) + "]";
                mes "Look here... you don't have any Items on...";
                close;
            }
            if (checkweight(.@refineitemid,1) == 0 ) {
                next;
                mes "[" + getarg(0) + "]";
                mes "Hey you are overweight, try storing some items first.";
                close;
            }
            if (getequipid(.@part) != .@refineitemid || (.@menu2 == 1 && getequippercentrefinery(.@part) < 100)) {
                next;
                mes "[" + getarg(0) + "]";
                mes "You changed your equipment!";
                mes "You filthy scum!!!";
                next;
                atcommand "@nuke "+strcharinfo(0);
                end;
            }
            mes "Clang, clang!!!";
            if(.@menu2 == 2 && getequippercentrefinery(.@part) <= rand(100)) {
                failedrefitem .@part;
                emotion 23;
                mes "[" + getarg(0) + "]";
                mes "WAHHHH!!! I'm so sorry... I warned you this could happen...";
                set .@refinecnt,.@refinecnt - 1;
                if(.@refinecnt == 0) close;
                mes "Here's the unused Zeny and Material back...";
                getitem .@material,.@refinecnt;
                set .@fullprice,.@refinecnt * .@price;
                set Zeny,Zeny + .@fullprice;
                close;
            }
            successrefitem .@part;
            emotion 21;
            set .@refinecnt,.@refinecnt - 1;
            next;
        }
    }
    else {
    
        if ( getbrokenid (.@refineitemid) ) {
            mes "[" + getarg(0) + "]";
            mes "Sorry but I can't work to refine an equipment if you have another of the same kind of item that's not repaired in your inventory.";
            close;
        }
        if(countitem(.@material) < .@j || Zeny < .@fullprice) {
            mes "[" + getarg(0) + "]";
            mes "Is that all you got? Unfortunately I can't work for you at a lower price. Try putting yourself in my shoes.";
            close;
        }
        
        set .@breakme, 0;
        
        while(1){
        
            for (set .@c, 0; .@c < .@re; set .@c, .@c + 1)
                deletearray getd(".@equip_inf"+.@c);
            
            if ( getequipisequiped(.@part) == 0 ) {
                equip .@refineitemid;
                set .@re, 0;
                while ( getequiprefinerycnt(.@part) >= .@refinecnt ) {
                    for (set .@c, 0; .@c < 4; set .@c, .@c + 1)
                        if (getequipcardid(.@part,.@c) != 0)
                            setd ".@equip_inf"+.@re+"[.@c]", getequipcardid(.@part,.@c);
                    setd ".@equip_inf"+.@re+"[4]", getequiprefinerycnt(.@part);
                    unequip .@part;
                    delitem2 .@refineitemid,1,1,getd(".@equip_inf"+.@re+"[4]"),0,getd(".@equip_inf"+.@re+"[0]"),
                    getd(".@equip_inf"+.@re+"[1]"),getd(".@equip_inf"+.@re+"[2]"),getd(".@equip_inf"+.@re+"[3]");
                    equip .@refineitemid;
                    set .@re, .@re + 1;
                }
                if (.@re) {
                    for (set .@c, 0; .@c < .@re; set .@c, .@c + 1) {
                        getitem2 .@refineitemid,1,1,getd(".@equip_inf"+.@c+"[4]"),0,getd(".@equip_inf"+.@c+"[0]"),
                        getd(".@equip_inf"+.@c+"[1]"),getd(".@equip_inf"+.@c+"[2]"),getd(".@equip_inf"+.@c+"[3]");
                    }
                }
                for (set .@c, 0; .@c < .@re; set .@c, .@c + 1)
                    deletearray getd(".@equip_inf"+.@c);
            }
            
            if (checkweight(.@refineitemid,1) == 0 ) {
                next;
                mes "[" + getarg(0) + "]";
                mes "Hey you are overweight, try storing some items first.";
                close;
            }
            
            if ( (getequipid(.@part) != .@refineitemid) || (.@menu2 == 1 && getequippercentrefinery(.@part) < 100)) {
                next;
                mes "[" + getarg(0) + "]";
                mes "You changed your equipment!";
                mes "You filthy scum!!!";
                next;
                atcommand "@nuke "+strcharinfo(0);
                end;
            }
            
            if (getequiprefinerycnt(.@part) >= 10) {
                next;
                mes "[" + getarg(0) + "]";
                mes "You changed your equipment!";
                mes "You filthy scum!!!";
                next;
                atcommand "@nuke "+strcharinfo(0);
                end;
            }
            
            if (!M_quickref) {
                set .@rand, rand(1,4);
                if (.@rand == 1)
                    mes "cLanG, clang ClAng!";
                else if (.@rand == 2)
                    mes "ClaNg ClAng claNg!";
                else if (.@rand == 3)
                    mes "clANg Clang CLanG!";
                else if (.@rand == 4)
                    mes "CLang cLanG cLANg!";
            }
            else if (!.@breakme) {
                mes "ClAng ClanG ClanG Clangg CLAgn Cnaglnac CLnacnlnagCALNGa ClangaglnaCLAnagacalNCagaCLNAangalncalclanCLANGlancLANgacln!!!";
                mes "^FF0000(Please do not Log-Off while in this process)^000000";
                set .@breakme, 1;
            }
            set Zeny, Zeny - .@price;
            delitem .@material, 1;
            
            if(getequippercentrefinery(.@part) <= rand(100)) {
                set .@breakgap, .@refinecnt - getequiprefinerycnt(.@part) ;
                set .@j, .@j - .@breakgap ;
                failedrefitem .@part;
                if(.@j <= 0) close;
            }
            else {
                successrefitem .@part;
                set .@j, .@j - 1;
                if(.@j <= 0) close;
                set .@re, 0;
                while ( getequiprefinerycnt(.@part) >= .@refinecnt ) {
                    for (set .@c, 0; .@c < 4; set .@c, .@c + 1)
                        if (getequipcardid(.@part,.@c) != 0)
                            setd ".@equip_inf"+.@re+"[.@c]", getequipcardid(.@part,.@c);
                    setd ".@equip_inf"+.@re+"[4]", getequiprefinerycnt(.@part);
                    unequip .@part;
                    delitem2 .@refineitemid,1,1,getd(".@equip_inf"+.@re+"[4]"),0,getd(".@equip_inf"+.@re+"[0]"),
                    getd(".@equip_inf"+.@re+"[1]"),getd(".@equip_inf"+.@re+"[2]"),getd(".@equip_inf"+.@re+"[3]");
                    equip .@refineitemid;
                    set .@re, .@re + 1;
                }
                if (.@re) {
                    for (set .@c, 0; .@c < .@re; set .@c, .@c + 1) {
                        getitem2 .@refineitemid,1,1,getd(".@equip_inf"+.@c+"[4]"),0,getd(".@equip_inf"+.@c+"[0]"),
                        getd(".@equip_inf"+.@c+"[1]"),getd(".@equip_inf"+.@c+"[2]"),getd(".@equip_inf"+.@c+"[3]");
                    }
                }
            }
            if (!M_quickref)
                next;
            else {
                set .@clang, .@clang + 1;
                    sleep2 300;
            }
        }
    }
    mes "[" + getarg(0) + "]";
    mes "All finished... Come again soon.";
    close;      
}
 
 
 
//==============================================================================
// Material Salesmen
//==============================================================================
prt_in,56,69,4  script  Vurewell    86,{
    callfunc "phramain","Vurewell";
    end;
}
payon,145,178,4 script  Begnahd 88,{
    callfunc "phramain","Begnahd";
    end;
}
morocc_in,65,37,4   script  Sade    99,{
    callfunc "phramain","Sade";
    end;
}
alberta_in,18,59,5  script  Kahlamanlith    86,{
    callfunc "phramain","Kahlamanlith";
    end;
}
yuno_in01,171,26,6  script  Dillemat    88,{
    callfunc "phramain","Dillemat";
    end;
}
ein_in01,15,87,7    script  Tirehaus    86,{
    callfunc "phramain","Tirehaus";
    end;
}
lhz_in02,278,24,3   script  Krugg   86,{
    callfunc "phramain","Krugg";
    end;
}
 
//============================================================
//= Material Salesmen Functions
//============================================================
function    script  phramain    {
    if (checkweight(1201,1) == 0) {
        mes "- Wait a minute !! -";
        mes "- Currently you're carrying -";
        mes "- too many items with you. -";
        mes "- Please try again -";
        mes "- after you loose some weight. -";
        close;
    }
    mes "[" + getarg(0) + "]";
    mes "I have ^777777Phracons^000000 and ^777777Emveretarcons^000000 for sale.";
    mes "I can also trade some more unique materials such as ^0000FFBradiums^000000 and ^0000FFKaluniums^000000";
    next;
    switch(select("Phracon - 200 Zeny:Emveretarcon - 1000 Zeny:Trade Elunium->Kalunium:Trade Oridecon->Bradium:Trade Refined Bradium->Bradium:Trade Tiny Bradium->Bradium:Trade Bradium->Oridecon:Trade Kalunium->Elunium:Ask about other Metals")) {
    case 1:
        set .@material,1010;
        set .@price,200;
        set .@buying, 1;
        break;
    case 2:
        set .@material,1011;
        set .@price,1000;
        set .@buying, 1;
        break;
    case 3: // Elunium -> Kalunium
        set .@amount1, 3; // Material 1 Quantity Cost
        set .@material1, 985; // Material 1 ID
        set .@price, 50000; // Trade Cost
        set .@material2, 6223; // Material 2 ID
        set .@amount2, 1; // Material 2 Quantity Received
        set .@buying, 0; // Leave this alone
        break;
    case 4: // Oridecon -> Bradium
        set .@amount1, 3; // Material 1 Quantity Cost
        set .@material1, 984; // Material 1 ID
        set .@price, 80000; // Trade Cost
        set .@material2, 6224; // Material 2 ID
        set .@amount2, 1; // Material 2 Quantity Received
        set .@buying, 0; // Leave this alone
        break;
    case 5: // Refined Bradium -> Bradium
        set .@amount1, 1; // Material 1 Quantity Cost
        set .@material1, 6090; // Material 1 ID
        set .@price, 60000; // Trade Cost
        set .@material2, 6224; // Material 2 ID
        set .@amount2, 2; // Material 2 Quantity Received
        set .@buying, 0; // Leave this alone
        break;
    case 6: // Tiny Bradium -> Bradium
        set .@amount1, 10; // Material 1 Quantity Cost
        set .@material1, 6319; // Material 1 ID
        set .@price, 40000; // Trade Cost
        set .@material2, 6224; // Material 2 ID
        set .@amount2, 1; // Material 2 Quantity Received
        set .@buying, 0; // Leave this alone
        break;
    case 7: // Bradium -> Oridecon
        set .@amount1, 1; // Material 1 Quantity Cost
        set .@material1, 6224; // Material 1 ID
        set .@price, 20000; // Trade Cost
        set .@material2, 984; // Material 2 ID
        set .@amount2, 3; // Material 2 Quantity Received
        set .@buying, 0; // Leave this alone
        break;
    case 8: // Kalunium -> Elunium
        set .@amount1, 1; // Material 1 Quantity Cost
        set .@material1, 6223; // Material 1 ID
        set .@price, 30000; // Trade Cost
        set .@material2, 985; // Material 2 ID
        set .@amount2, 3; // Material 2 Quantity Received
        set .@buying, 0; // Leave this alone
        break;
    default:
        mes "[" + getarg(0) + "]";
        mes "Other metals?";
        mes "Have you heard about the ^009900Unique Power Stones^000000? They are pretty damn powerfull.";
        mes "I heard if you get some of them together, you can have an outstanding magical power.";
        mes "Other than that, I can't think of any other metal, except ^FF0000High Density Bradiums, Kaluniums, Oridecons ^000000and ^FF0000Eluniums^000000.";
        mes "But I have no idea where to get those.";
        close;
        
    }
    if (.@buying) {
        mes "[" + getarg(0) + "]";
        mes "So how many do you wish to buy?";
        mes "If you don't want any, please enter the number, '0.'";
        next;
        while(1) {
            input .@input;
            if (.@input == 0) {
                mes "[" + getarg(0) + "]";
                mes "The deal has";
                mes "been cancelled.";
                close;
            }
            else if (.@input < 0 || .@input > 500) {
                mes "[" + getarg(0) + "]";
                mes "Alright, you can";
                mes "puchase up to 500.";
                mes "No more than that,";
                mes "got it? Good.";
                next;
            }
            else {
                break;
            }
        }
        set .@sell,.@input * .@price;
        if (Zeny < .@sell) {
            mes "[" + getarg(0) + "]";
            mes "Err...";
            mes "You don't have";
            mes "enough Zeny to buy";
            mes ""+ .@input +" of them.";
            close;
        }
        if (checkweight(.@material,.@input) == 0) {
            mes "[" + getarg(0) + "]";
            mes "Hmm...";
            mes "I can't give you anything if you don't have enough room in your inventory. Why don't you put your extra things in Kafra Storage and try again?";
            close;
        }
        set Zeny,Zeny-.@sell;
        getitem .@material,.@input;
        mes "[" + getarg(0) + "]";
        mes "Here you are!";
        mes "Thank you for";
        mes "your patronage.";
        close;
    }
    else {
        mes "[" + getarg(0) + "]";
            mes "It will cost you "+.@amount1+" ^0000FF"+getitemname(.@material1)+"^000000 and ^009933"+.@price+" Zeny^000000 per trade. In exchange, you will get "+.@amount2+" ^FF0000"+getitemname(.@material2)+"^000000. How many times would you like to trade? Input '0' to cancel.";
            next;
            while(1) {
                input .@input;
                if (.@input == 0) {
                    mes "[" + getarg(0) + "]";
                    mes "The deal has";
                    mes "been cancelled.";
                    close;
                }
                else if (.@input < 0 || .@input > 500) {
                    mes "[" + getarg(0) + "]";
                    mes "Alright, you can";
                    mes "trade up to 500.";
                    mes "No more than that,";
                    mes "got it? Good.";
                    next;
                }
                else {
                    break;
                }
            }
            set .@sell,.@input * .@price;
            if (Zeny < .@sell) {
                mes "[" + getarg(0) + "]";
                mes "Err...";
                mes "You don't have";
                mes "enough Zeny to trade";
                mes ""+ .@input +" of them.";
                close;
            }
            if (checkweight(.@material2,.@input * .@amount2) == 0) {
                mes "[" + getarg(0) + "]";
                mes "Hmm...";
                mes "I can't give you anything if you don't have enough room in your inventory. Why don't you put your extra things in Kafra Storage and try again?";
                close;
            }
            set .@mat1_amount, .@input * .@amount1;
            if (countitem(.@material1) < .@mat1_amount ) {
                mes "[" + getarg(0) + "]";
                mes "You don't have enough ^0000FF"+getitemname(.@material1)+"^000000. Come back when you do.";
                close;
            }
            delitem .@material1, .@mat1_amount;
            getitem .@material2, .@input * .@amount2;
            set Zeny,Zeny-.@sell;
            mes "[" + getarg(0) + "]";
            mes "Here you are!";
            mes "Thank you for";
            mes "your patronage.";
            close;
    }
}
 
 
 
//==============================================================================
// Ori/Elu Refiners
//==============================================================================
prt_in,63,69,4  script  Dietrich    84,{
    callfunc "orimain","Dietrich";
    end;
}
payon,137,178,4 script  Hakhim  88,{
    callfunc "orimain","Hakhim";
    end;
}
morocc_in,72,32,4   script  Abdul   99,{
    callfunc "orimain","Abdul";
    end;
}
alberta_in,21,63,5  script  Xenophon    84,{
    callfunc "orimain","Xenophon";
    end;
}
yuno_in01,171,22,6  script  Delayt  88,{
    callfunc "orimain","Delayt";
    end;
}
ein_in01,18,82,6    script  Matestein   84,{
    callfunc "orimain","Matestein";
    end;
}
lhz_in02,281,24,5   script  Fruel   84,{
    callfunc "orimain","Fruel";
    end;
}
 
//============================================================
//= Ori/Elu Functions
//============================================================
function    script  orimain {
    if (checkweight(1201,1) == 0) {
        mes "- Wait a minute !! -";
        mes "- Currently you're carrying -";
        mes "- too many items with you. -";
        mes "- Please try again -";
        mes "- after you loose some weight. -";
        close;
    }
    mes "[" + getarg(0) + "]";
    mes "I can purify your";
    mes "Rough Oridecons or";
    mes "Rough Eluniums. I'll need";
    mes "5 Rough Stones to make";
    mes "1 pure one for you.";
    next;
    switch(select("Make Oridecon:Make Elunium:Ask about Enchanted Stones")) {
    case 1:
        if (countitem(756) > 4) {
            delitem 756,5;  //Oridecon_Stone
            getitem 984,1; // Oridecon
            mes "[" + getarg(0) + "]";
            mes "Here's your Oridecon.";
            mes "You're welcome to come";
            mes "back whenever you want.";
            close;
        }
        else {
            mes "[" + getarg(0) + "]";
            mes "You're kidding me, right?";
            mes "I just told you that I need 5 Rough Oridecons to make a pure Oridecon.";
            close;
        }
    case 2:
        if (countitem(757) > 4) {
            delitem 757,5;  //Elunium_Stone
            getitem 985,1; // Elunium
            mes "[" + getarg(0) + "]";
            mes "Here's your Elunium.";
            mes "You're welcome to come";
            mes "back whenever you want.";
            close;
        }
        else {
            mes "[" + getarg(0) + "]";
            mes "You're kidding me, right?";
            mes "I just told you that I need 5 Rough Eluniums to make a pure Elunium.";
            close;
        }
    case 3:
        mes "[" + getarg(0) + "]";
        mes "Enchanted Stones...?";
        mes "I've been a stonesmith for 20 years, so I've heard a lot about them. Supposedly, there are";
        mes "four different kinds.";
        next;
        mes "[" + getarg(0) + "]";
        mes "Each Enchanted Stone possesses one of the following elemental properties: Earth, Wind, Water and Fire.";
        next;
        mes "[" + getarg(0) + "]";
        mes "If someone combines a Enchanted Stone with a weapon while smithing, that weapon will possess the same property as the Stone.";
        next;
        mes "[" + getarg(0) + "]";
        mes "Needless to say, you need to have some smithing skill to produce this kind of elemental weapon.";
        close;
    }
}
 
 
 
//=====================================================================================
// Equipment Repairmen
//=====================================================================================
alberta_in,31,65,4  script  Repairman#alb   86,{
    callfunc "repairmain","Repairman";
    end;
}
 
moc_ruins,107,94,5  script  Repairman#moc   99,{
    callfunc "repairmain","Repairman";
    end;
}
 
payon,143,165,4 script  Repairman#pay   88,{
    callfunc "repairmain","Repairman";
    end;
}
 
prt_in,63,54,2  script  Repairman#prt   86,{
    callfunc "repairmain","Grendal";
    end;
}
 
yuno_in01,175,28,3  script  Repairman#juno  86,{
    callfunc "repairmain","Repairman";
    end;
}
 
geffen_in,34,166,3  script  Repairman#gef   99,{
    callfunc "repairmain","Repairman";
    end;
}
 
aldeba_in,38,60,3   script  Repairman#alde  86,{
    callfunc "repairmain","Repairman";
    end;
}
 
lhz_in02,284,14,3   script  Repairman#lhz   86,{
    callfunc "repairmain","Repairman";
    end;
}
 
//============================================================
//= Equipment Repair Function
//============================================================
function    script  repairmain  {
    set .@repairprice,5000;
    mes "["+getarg(0)+"]";
    mes "Hey there!";
    mes "Do you want me";
    mes "to repair any items?";
    mes "You can count on me";
    mes "for item repairs!";
    next;
    switch(select("Actually, I do have some items...:None at the moment.")) {
    case 1:
        set .@checkitem,1;
        while (1) {
            if (getbrokenid(.@checkitem) == 0) {
                break;
            }
            set .@checkitem,.@checkitem+1;
        }
        set .@checkitem,.@checkitem-1;
        if (!.@checkitem) {
            mes "["+getarg(0)+"]";
            mes "Oh wow, this is incredible!";
            mes "You must take very good care of your things. None of your items are damaged!";
            next;
            mes "["+getarg(0)+"]";
            mes "If everyone is like you, I'm going to be unemployed!! Haha~!";
            close;
        }
        mes "["+getarg(0)+"]";
        mes "Hmm...";
        mes "Let's see...";
        mes "Out of all your items,";
        mes "" + .@checkitem + " are damaged.";
        mes "Would you like to repair?";
        next;
        set .@totalcost,.@repairprice*.@checkitem;
        mes "["+getarg(0)+"]";
        mes "Each repair costs " + .@repairprice + " Zeny. So to repair all your damaged items would cost " + .@totalcost + " Zeny! Would you like to repair the items?";
        next;
        switch(select("Yes:No")) {
        case 1:
            if (Zeny < .@totalcost) {
                mes "["+getarg(0)+"]";
                mes "Whoa whoa...";
                mes "Check your wallet before you receive the repair bill! I can't repair anything because you don't have enough Zeny.";
                close;
            }
            set .@checkitem2,1;
            while (1) {
                if (getbrokenid(.@checkitem2) == 0) {
                    break;
                }
                set .@checkitem2,.@checkitem2+1;
            }
            set .@checkitem2,.@checkitem2-1;
            if (.@checkitem == .@checkitem2) {
                set Zeny,Zeny-.@totalcost;
                while (.@checkitem) {
                    repair(.@checkitem);
                    set .@checkitem,.@checkitem-1;
                }
                mes "["+getarg(0)+"]";
                mes "Okay! All done. Now, try to be a little more careful. Items have lives too you know.";
                close;
            }
            else {
                mes "["+getarg(0)+"]";
                mes "Mmm? Something's wrong. Wait... Equip the items you need to repair and then come back to me.";
                close;
            }
        case 2:
            mes "["+getarg(0)+"]";
            mes "Well, it's no skin off my nose, but it's not good to leave items damaged. You should get them repaired as soon as possible!";
            close;
        }
    case 2:
        mes "["+getarg(0)+"]";
        mes "Hohoho...";
        mes "You don't have";
        mes "any business with me";
        mes "if you don't have any";
        mes "items to repair.";
        close;
    }
}
 
Viewed 589 times, submitted by Guest.