viewing paste Unknown #15539 | 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
/*=========================================================
Headgear Color Reverter NPC
by Zephy
===========================================================
Description:
===========================================================
An NPC to revert a colored headgear to its original 
pallete.
===========================================================
Additional Notes:
===========================================================
Changelog:
=========================================================*/
 
amatsu,261,238,4    script  Color Reverter::c_reverter  911,{
 
    // Opening dialogue
    mes .npc_name$;
    mes "I am the color reverter NPC!";
    mes "I can revert any of these headgears back to its original color!";
    mes "All I need is: ";
    mes "- ^FF0000"+ .qamt +" "+ getitemname(.qitem) +"^000000";
    mes "- ^FF0000"+ .zeny_amt$ +" zeny.^000000";
    next;
 
    // Bease headgear menu
    // Loop for the menu
    for(set .@i,0; .@i < getarraysize(.base_hg); set .@i, .@i+1)
    {
        set .@base_options$[.@i], getitemname(.base_hg[.@i]);
    }
 
    menu implode(.@base_options$,":"),-;
    set .@choice, @menu - 1; // Indexing purposes
 
    mes .npc_name$;
    mes "Please pick the color ^aa007fOF YOUR CURRENT^000000 headgear.";
    next;
    
    switch(@menu)
    {
        
        case 1: // Scarf
            // Loop for the menu
            for(set .@i,0; .@i < getarraysize(.color_scarf); set .@i, .@i+1)
                {
                set .@scarf_options$[.@i], getitemname(.color_scarf[.@i]);
            }
            
            menu implode(.@scarf_options$,":"),-;
            set .@headgear, .color_scarf[@menu - 1]; // Indexing and Check purposes
            
            break;
 
    
        case 2: // Gangster Scarf
            // Loop for the menu
            for(set .@i,0; .@i < getarraysize(.color_gangster); set .@i, .@i+1)
            {
                set .@gangster_options$[.@i], getitemname(.color_gangster[.@i]);
            }
 
            menu implode(.@gangster_options$,":"),-;
            set .@headgear, .color_gangster[@menu - 1]; // Indexing and Check purposes
            
            break;
 
        case 3: // Lighthalzen Aura
            // Loop for the menu
            for(set .@i,0; .@i < getarraysize(.color_lighthalzen); set .@i, .@i+1)
            {
                set .@lighthalzen_options$[.@i], getitemname(.color_lighthalzen[.@i]);
            }
 
            menu implode(.@lighthalzen_options$,":"),-;
            set .@headgear, .color_lighthalzen[@menu - 1]; // Indexing and Check purposes
            
            break;
        
    }
    
    // Check if player has required headgear equipped
        if(getequipid(EQI_HEAD_TOP) != .@headgear)
    {
        mes .npc_name$;
        mes "Please equip the required headgear.";
        close;
    }
 
    // Check if the headgear has a card
    if(getequipcardcnt(EQI_HEAD_TOP) > 0)
    {
        mes .npc_name$;
        mes "Please make sure all cards have been removed before proceeding.";
        close;
    }
 
    // Check if player has the required items
    if(countitem(.qitem) < .qamt || Zeny < .zeny)
    {
        mes .npc_name$;
        mes "Please remember, I require ^FF0000"+ .qamt +" "+ getitemname(.qitem) +" and "+ .zeny +" zeny.^000000";
        close;
    }
    
    // Final warning about refinement
    mes .npc_name$;
    mes "^FF0000Please remember that any refinement done to this headgear will be lost. Would you like to continue?";
    next;
    
    // Final chance to say no
    if(select("No:Yes") == 1)
    {
        mes .npc_name$;
        mes "Come back if you change your mind!";
        close;
    }
    
    // Delete items, reduce Zeny, and unequip the headgear
    delitem .qitem, .qamt;
    set Zeny, Zeny-.zeny;
    unequip EQI_HEAD_TOP;
    delitem .@headgear, 1;
    
    // Get OC headgear
    getitem .base_hg[.@choice], 1;
    
    // Ending dialogue
    mes .npc_name$;
    mes "Enjoy your headgear!";
    close;
 
OnInit:
// Configuration
        // General
        set .npc_name$, "[^008800Color Reverter^000000]";
 
        // Requirements
        set .qitem, 8063; // Ancient Heirloom
        set .qamt, 1; // .qitem amount
        set .zeny, 30000000; // Set Zeny price
        set .zeny_amt$, "30,000,000"; // Set zeny string amount
 
        // Headgears
        setarray .base_hg[0], 17445, 5361, 17456; // Scarf, Gangster Scarf, Lighthalzen Aura
        setarray .color_scarf[0], 22335, 22336, 22337, 22338, 22339, 22340; // Blue, Cyan, Gold, Pink, Red, Green
        setarray .color_gangster[0], 22320, 22321, 22322, 22323, 22324, 22325, 22326; // Black, Blue, Cyan, Gold, Green, Purple, White
        setarray .color_lighthalzen[0], 17457, 17458, 17460, 22364, 22365, 22366; // Black, Blue, Red, Green, Pink, Purple
    
    end;
}
Viewed 573 times, submitted by Guest.