- script eggrepair_atcommand -1,{
OnInit:
bindatcmd "eggrepair",strnpcinfo(3)+"::OnDo";
end;
OnDo:
set $npcname$,"[Egg Fixer]";
mes $npcname$;
mes "Hey, I can fix your broken Pet/Pokemon Eggs!! But make sure to not have multiple of the same egg in your Inventory! Only the broken Egg!";
mes "Make sure you have the ITEM ID ready!";
next;
mes "Would you like to repair the broken egg?";
menu "Yes",y_ex,"No",n_ex,"ITEM ID of eggs",n_eggs;
y_ex:
mes "Input the Item id of the egg you want to get fixed. This will delete the current egg and replace it with a new one!";
input @petid;
next;
mes "*Checking the Item*";
next;
if (countitem(@petid) <= 0)
{ mes "You don't have that Item"; close;}
delitem @petid,1;
getitem @petid,1;
mes $npcname$;
mes "Your Egg has been restored.";
soundeffect "healsound.wav", 0;
close;
n_ex:
mes "Please come again.";
close;
n_eggs:
next;
mes "I will now get the ITEM IDs of the eggs in your inventory.";
next;
set @charAccNumber,getcharid(0,strcharinfo(0));
query_sql "SELECT `nameid` FROM `inventory` WHERE `card0`='-256' AND `char_id`="+@charAccNumber, @name;
mes "Pokemon Egg IDs:";
for (set .@i,0; .@i < getarraysize(@name); set .@i,.@i+1) {
mes (.@i+1) + ". " + getitemname(@name[.@i]) + " ("+ @name[.@i] +")";
}
close;
}