R>Weapon breaking after an hour? + npc

classy5

New member
Messages
119
Points
0
Github
classy5
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?

 
Last edited by a moderator:
This can't be done with script alone, need source edits (moved to source request)

 
hell yeah this can be done with scripts alone

move back to script request

Code:
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;}
 
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 aloneWhile with plugin/source, one can add a time variable in item_data and can process each weapon separately...

 
Back
Top