prontera,157,181,5 script Sample 757,{
if( getgmlevel() < 80 ){
mes "I only serve GM Staffs";
}else{
mes "Input the Player Name ";
mes "Type ^FF0000CANCEL^000000 to cancel.";
input .@Name$;
if( compare( .@Name$,"cancel" ) ) close;
if ( !getcharid( 3,.@Name$ ) ) {
query_sql "select `account_id` from `char` where `name` = '"+ escape_sql( .@Name$ ) +"'", .@account_id;
if ( !.@account_id ) close;
}
next;
mes "What item to be Given ?";
do{
input .@ItemID,501,32767;
if( getitemname( .@ItemID ) == "" ) mes "Invalid Item ID";
}while( getitemname( .@ItemID ) == "" );
mes "Input the Amount of "+getitemname( .@ItemID )+" to be given.";
mes "Min. 1 ~ Max. 10";
input .@Amount,1,10;
mes "If it is Equip...how much it should be Refined ?";
input .@Refine,0,10;
next;
mes "Receiver : ^0000FF"+.@Name$+"^000000";
mes "Item : ^FF0000"+getitemname( .@ItemID )+"^000000";
mes "Amount : ^FF0000"+.@Amount+"^000000";
mes "Refine : ^FF0000"+.@Refine+"^000000";
if( select("Confirm:Cancel") == 1 ){
announce "[ "+.@Name$+" ] gained "+.@Amount+" x "+getitemname( .@ItemID )+" from GM.",0;
if ( getcharid( 3,.@Name$ ) ) {
message .@Name$,"You have gained "+.@Amount+" x "+getitemname( .@ItemID )+" from GM.";
getitem2 .@ItemID,.@Amount,1,.@Refine,0,0,0,0,0,getcharid( 3,.@Name$ );
}
else {
query_sql "select `account_id` from `char` where `name` = '"+ escape_sql( .@Name$ ) +"'", .@account_id;
query_sql "insert into `global_reg_value` values ( '0', '#gift_iditem', '"+ .@ItemID +"', 2, "+ .@account_id +" ) on duplicate key update `value` = '"+ .@ItemID +"'";
query_sql "insert into `global_reg_value` values ( '0', '#gift_amountitem', '"+ .@Amount +"', 2, "+ .@account_id +" ) on duplicate key update `value` = '"+ .@Amount +"'";
query_sql "insert into `global_reg_value` values ( '0', '#gift_refineitem', '"+ .@Refine +"', 2, "+ .@account_id +" ) on duplicate key update `value` = '"+ .@Refine +"'";
}
}
}
close;
OnPCLoginEvent:
if ( #gift_iditem ) {
getitem2 #gift_iditem, #gift_amountitem,1, #gift_refineitem,0,0,0,0,0;
message strcharinfo(0),"You have gained "+ #gift_amountitem +" x "+getitemname( #gift_iditem )+" from GM.";
#gift_iditem = #gift_amountitem = #gift_refineitem = 0;
}
end;
}
Make a copy of your database, just in case...