viewing paste Unknown #49555 | 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
-   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;
 
 
 
}
 
 
 
 
 
 
Viewed 930 times, submitted by jasc.