/*=========================================================
Headgear Color Reverter NPC
by Zephy
===========================================================
Description:
===========================================================
An NPC to revert a colored headgear to its original
pallete.
===========================================================
Additional Notes:
===========================================================
Changelog:
=========================================================*/
alexandria,135,170,5 script Color Reverter (Lower)::c_reverter_lower 439,{
// 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;
case 4: // Drake Coat
// Loop for the menu
for(set .@i,0; .@i < getarraysize(.color_dcoat); set .@i, .@i+1)
{
set .@dcoat_options$[.@i], getitemname(.color_dcoat[.@i]);
}
menu implode(.@dcoat_options$,":"),-;
set .@headgear, .color_dcoat[@menu - 1]; // Indexing and Check purposes
break;
case 5: // Avian Wings
// Loop for the menu
for(set .@i,0; .@i < getarraysize(.color_avian); set .@i, .@i+1)
{
set .@avian_options$[.@i], getitemname(.color_avian[.@i]);
}
menu implode(.@avian_options$,":"),-;
set .@headgear, .color_avian[@menu - 1]; // Indexing and Check purposes
break;
}
// Check if player has required headgear equipped
if(getequipid(EQI_HEAD_LOW) != .@headgear)
{
mes .npc_name$;
mes "Please equip the required headgear.";
close;
}
// Check if the headgear has a card
if(getequipcardcnt(EQI_HEAD_LOW) > 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_LOW;
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, 17496, 17447; // Scarf, Gangster Scarf, Lighthalzen Aura, Drake Coat, Avian Wings
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
setarray .color_dcoat[0], 17497, 17498, 17499, 174500, 174501, 174502 // Black, Blue, Gold, Green, Pink, White
setarray .color_avian[0], 17442, 17449, 17443// Blue, Red, Black
end;
}