/*=========================================================
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: // Beanie
// Loop for the menu
for(set .@i,0; .@i < getarraysize(.color_beanie); set .@i, .@i+1)
{
set .@beanie_options$[.@i], getitemname(.color_beanie[.@i]);
}
menu implode(.@beanie_options$,":"),-;
set .@headgear, .color_beanie[.@color]; // Indexing and Check purposes
break;
case 2: // EX Valkyrie Helemet
// Loop for the menu
for(set .@i,0; .@i < getarraysize(.color_valkyrie); set .@i, .@i+1)
{
set .@valkyrie_options$[.@i], getitemname(.color_valkyrie[.@i]);
}
menu implode(.@valkyrie_options$,":"),-;
set .@headgear, .color_valkyrie[@menu - 1]; // Indexing and Check purposes
break;
case 3: // Baseball Cap
// Loop for the menu
for(set .@i,0; .@i < getarraysize(.color_baseball); set .@i, .@i+1)
{
set .@baseball_options$[.@i], getitemname(.color_baseball[.@i]);
}
menu implode(.@baseball_options$,":"),-;
set .@headgear, .color_baseball[@menu - 1]; // Indexing and Check purposes
break;
case 4: // 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 5: // Hunter's Hat
// Loop for the menu
for(set .@i,0; .@i < getarraysize(.color_hunter); set .@i, .@i+1)
{
set .@hunter_options$[.@i], getitemname(.color_hunter[.@i]);
}
menu implode(.@hunter_options$,":"),-;
set .@headgear, .color_hunter[@menu - 1]; // Indexing and Check purposes
break;
case 6: // Coppola
// Loop for the menu
for(set .@i,0; .@i < getarraysize(.color_coppola); set .@i, .@i+1)
{
set .@coppola_options$[.@i], getitemname(.color_coppola[.@i]);
}
menu implode(.@coppola_options$,":"),-;
set .@headgear, .color_coppola[@menu - 1]; // Indexing and Check purposes
break;
case 7: // Captian's Hat
// Loop for the menu
for(set .@i,0; .@i < getarraysize(.color_captain); set .@i, .@i+1)
{
set .@captain_options$[.@i], getitemname(.color_captain[.@i]);
}
menu implode(.@captain_options$,":"),-;
set .@headgear, .color_captain[@menu - 1]; // Indexing and Check purposes
break;
case 8: // 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 9: // 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;
case 10: // Cat Ears
// Loop for the menu
for(set .@i,0; .@i < getarraysize(.color_catears); set .@i, .@i+1)
{
set .@catears_options$[.@i], getitemname(.color_catears[.@i]);
}
menu implode(.@catears_options$,":"),-;
set .@headgear, .color_catears[@menu - 1]; // Indexing and Check purposes
break;
}
// Check if player has required headgear equipped
if((getequipid(EQI_HEAD_TOP) != .@headgear) || (getequipid(EQI_HEAD_BOTTOM != .@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], 5076, 8047, 5282, 17445, 5383, 5200, 5184, 5361, 17456, 16201; // Beanie, EX Valkyrie Helm, Baseball Cap, Scarf, Hunter's Hat, Coppola, Captain's Hat, Gangster Scarf, Lighthalzen Aura, Cat Ears
setarray .color_beanie[0], 5235, 22308, 22311, 22310, 22309, 22307; // Gray, Red, Dark Blue, Green, Cyan, Black
setarray .color_valkyrie[0], 22346, 22347, 22348, 22349, 22350, 22351, 22352, 22353, 22354, 22354; // Black, Brown, Cyan, Gold, Green, Orange, Pink, Purple, Red, Silver
setarray .color_baseball[0], 5282, 22302, 22303, 22304, 22305, 22306, 22301; // Yellow, Cyan, Green, Purple, Red, White, Black
setarray .color_scarf[0], 22335, 22336, 22337, 22338, 22339, 22340; // Blue, Cyan, Gold, Pink, Red, Green
setarray .color_hunter[0], 22327, 22328, 22329, 22330, 22331, 22332, 22333; // Black, Blue, Cyan, Gold, Purple, White, Red
setarray .color_coppola[0], 22341, 22342, 22343, 22344, 22345; // Black, Blue, Cyan, Green, Red
setarray .color_captain[0], 22312, 22313, 22314, 22315, 22316, 22317, 22318, 22319, 22372; //Black, Blue, Green, Cyan, Gold, Purple, Red, White, Pink
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
setarray .color_catears[0], 22367, 22368, 22369, 22370, 22371; // Blue, Gold, Pink, Purple, Red
end;
}