Jump to content
  • 0
classy5

R>Weapon breaking after an hour? + npc

Question

anyone have script that after an hour the weapon break and it will needed repair?

 

& repair npc could give you choices how many hours (1,2 or 3) it will last?

Edited by classy5

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

hell yeah this can be done with scripts alone

move back to script request

prontera,155,185,5	script	fsdfdskj	100,{	if ( countitem(1201) ) {		.@brokencount = getbrokencount() +1;		if ( .@brokencount ) {			.@i = 1;			while ( getbrokenid(.@i) != 1201 && .@i < .@brokencount ) .@i++;			if ( .@i < .@brokencount ) {				mes "wanna use that crappy knife again ?";				next;				if ( select( "Yes", "No" ) == 2 ) close;				repair .@i;				knife_start_break = gettimetick(2);				addtimer 10000, strnpcinfo(0)+"::Onaaa";				close;			}	//	fall through		}		mes "you already have that crappy knife";		close;	}	mes "do you want an item that can break in 10 seconds ?";	next;	if ( select( "Yes", "No" ) == 2 ) close;	getitembound 1201, 1, 4;	knife_start_break = gettimetick(2);	addtimer 10000, strnpcinfo(0)+"::Onaaa";	close;Onaaa:	getinventorylist;	for ( .@i = 0; .@i < @inventorylist_count; ++.@i )		if ( @inventorylist_id[.@i] == 1201 ) break;	delitem 1201, 1;	getitembound2 1201,1,1, @inventorylist_refine[.@i], 1, @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i], 4;	knife_start_break = 0;	end;OnPCLoginEvent:	if ( !countitem(1201) ) end;	if ( knife_start_break + 10 < gettimetick(2) )		addtimer 1, strnpcinfo(0)+"::Onaaa"; // sometimes doevent doesn't work	else		addtimer ( knife_start_break + 10 - gettimetick(2) )*1000, strnpcinfo(0)+"::Onaaa";	end;}

Share this post


Link to post
Share on other sites
  • 0

This can't be done with script alone, need source edits (moved to source request)

Share this post


Link to post
Share on other sites
  • 0

hell yeah this can be done with scripts alonemove back to script request

prontera,155,185,5	script	fsdfdskj	100,{	if ( countitem(1201) ) {		.@brokencount = getbrokencount() +1;		if ( .@brokencount ) {			.@i = 1;			while ( getbrokenid(.@i) != 1201 && .@i < .@brokencount ) .@i++;			if ( .@i < .@brokencount ) {				mes "wanna use that crappy knife again ?";				next;				if ( select( "Yes", "No" ) == 2 ) close;				repair .@i;				knife_start_break = gettimetick(2);				addtimer 10000, strnpcinfo(0)+"::Onaaa";				close;			}	//	fall through		}		mes "you already have that crappy knife";		close;	}	mes "do you want an item that can break in 10 seconds ?";	next;	if ( select( "Yes", "No" ) == 2 ) close;	getitembound 1201, 1, 4;	knife_start_break = gettimetick(2);	addtimer 10000, strnpcinfo(0)+"::Onaaa";	close;Onaaa:	getinventorylist;	for ( .@i = 0; .@i < @inventorylist_count; ++.@i )		if ( @inventorylist_id[.@i] == 1201 ) break;	delitem 1201, 1;	getitembound2 1201,1,1, @inventorylist_refine[.@i], 1, @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i], 4;	knife_start_break = 0;	end;OnPCLoginEvent:	if ( !countitem(1201) ) end;	if ( knife_start_break + 10 < gettimetick(2) )		addtimer 1, strnpcinfo(0)+"::Onaaa"; // sometimes doevent doesn't work	else		addtimer ( knife_start_break + 10 - gettimetick(2) )*1000, strnpcinfo(0)+"::Onaaa";	end;}
I moved into source considering one can have multiple knife, and it would fail to satisfy all conditions with scripting alone

While with plugin/source, one can add a time variable in item_data and can process each weapon separately...

Share this post


Link to post
Share on other sites
  • 0

with plugin/source, one can add a time variable in item_data and can process each weapon separately...

that would be interesting

add this in my to do list

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.