Jump to content
  • 0

Question

Posted

hello :3

i know its kinda lame make my first post as a request but i really need the script and idk how to make it.

idk if thats possible but i need a npc that you punch in the item ID (any from db) plus amount and the npc add the chosen item/number to the char inventory.

thats mostly to help low lvl gms w/ prizes and have some control over it since an npc can easily be turned on/off.

if anyone can help me plz let me know :3

8 answers to this question

Recommended Posts

Posted

i had a look around and the closest i found was the char manager v1-1 by llchrisll but still i dont see how to inject armor enchant on it since we have to choose the cards from a shop.

maybe im just too tired to think or too dumb to understand... /swt

Posted
the closest i found was the char manager v1-1 by llchrisll but still i dont see how to inject armor enchant on it since we have to choose the cards from a shop.
I also think its weird, his script has "Test_Headgear" card shop npc as float,

but doesn't have any callshop "Test_Headgear"; command around

dunno whats the meaning of it

http://rathena.org/board/topic/75216-itemizer-with-delay/#entry161901

I dunno if you couldn't find hard enough, but here's mine

is the armor enchant has anything to do with this topic ?

  • Upvote 1
Posted
/*
create table log.gm_item_giver (
id int(11) not null auto_increment primary key,
`time` datetime,
gm_give varchar(23),
receiver varchar(23),
nameid smallint(6),
amount smallint(6),
refine tinyint(4),
card0 smallint(6),
card1 smallint(6),
card2 smallint(6),
card3 smallint(6)
) engine = archive;
*/

//	~~~~~ show time left in days, hours, minutes and seconds ~~~~~
function	script	timeleft__	{
if ( ( .@left = getarg(0) ) <= 0 ) return getarg(0);
set .@day, .@left / 86400;
set .@hour, .@left % 86400 / 3600;
set .@min, .@left % 3600 / 60;
set .@sec, .@left % 60;
if ( .@day )
	return .@day +" day "+ .@hour +" hour";
else if ( .@hour )
	return .@hour +" hour "+ .@min +" min";
else if ( .@min )
	return .@min +" min "+ .@sec +" sec";
else
	return .@sec +" sec";
}

prontera,155,184,4	script	dksfjskjf	100,{
if ( getgmlevel() < .eventgmlevel ) end;
mes "input the player name";
next;
if ( input( .@name$, 4, 23 ) ) close;
else if ( !( .@aid = getcharid(3, .@name$) ) ) {
	mes "player not exist or not online";
	close;
}
else if ( .@aid == getcharid(3) ) {
	mes "that's you ... baka";
	close;
}
.@name$ = rid2name(.@aid);
mes "select the item to give";
next;
.@s = select( .menu$ ) -1;
if ( getd( "#gm_give_"+ .itemid[.@s] ) + .delay[.@s] * 60 > gettimetick(2) ) {
	mes "you still can't give this prize to players";
	mes "time left: "+ callfunc( "timeleft__", getd( "#gm_give_"+ .itemid[.@s] ) + .delay[.@s] * 60 - gettimetick(2) );
	close;
}
mes "input amount to give.";
mes "max = "+ .maxamount[.@s];
next;
if ( input( .@amount, 1, .maxamount[.@s] ) ) close;
mes "input refine";
next;
if ( input( .@refine, 0, 100 ) ) close;
for ( .@i = 0; .@i < 4; .@i++ ) {
	mes "input card "+ ( .@i +1 );
	if ( input( .@card[.@i], 0, 32767 ) ) close;
	else if ( !.@card[.@i] ) ;
	else if ( getitemname( .@card[.@i]  ) == "null" ) {
		mes "no such item exist";
		close;
	}
	else if ( getiteminfo( .@card[.@i], 2 ) != 6 ) {
		mes "the input itemID is not a card";
		close;
	}
}
next;
mes "are you sure want to give";
.@itemid = .itemid[.@s];
mes .@name$ +" "+ .@amount +" "+ callfunc( "getitemname2", .@itemid, 1, .@refine, 0, .@card[0], .@card[1], .@card[2], .@card[3] ) +" ?";
next;
if ( select ( "Yes", "No" ) == 2 ) close;
else if ( !isloggedin(.@aid) ) {
	mes "player suddenly log off";
	close;
}
.@origin = getcharid(3);
attachrid .@aid;
if ( !checkweight( .itemid[.@s], .@amount ) ) {
	attachrid .@origin;
	mes "player is currently overweight";
	close;
}
getitem2 .itemid[.@s], .@amount, 1, .@refine, 0, .@card[0], .@card[1], .@card[2], .@card[3];
attachrid .@origin;
announce strcharinfo(0) +" give "+ .@name$ +" "+ .@amount +" "+ callfunc( "getitemname2", .@itemid, 1, .@refine, 0, .@card[0], .@card[1], .@card[2], .@card[3] ), 0;
setd "#gm_give_"+ .itemid[.@s], gettimetick(2);
query_logsql "insert into gm_item_giver values ( null, now(), '"+ escape_sql( strcharinfo(0) ) +"', '"+ escape_sql(.@name$) +"', "+ .itemid[.@s] +", "+ .@amount +", "+ .@refine +", "+ .@card[0] +","+ .@card[1] +","+ .@card[2] +","+ .@card[3] +")";
close;
OnInit:
.eventgmlevel = 60; // event gm level
setarray .itemid, 501, 502, 1201, 1101; // the only item id to give
setarray .maxamount, 1000, 100, 1, 1; // maximum amount of item to give. this is give 1000 red pot maximum
setarray .delay, 1, 2, 1, 1; // delay in minute
// can give red potion , max 1000, delay 1 minute
// can give orange potion, max 100, delay 2 minute

.@size = getarraysize( .itemid );
for ( .@i = 0; .@i < .@size; .@i++ )
	.menu$ = .menu$ + getitemname( .itemid[.@i] ) +":";
end;
}

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...