classy5 0 Posted November 30, 2015 (edited) 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 November 30, 2015 by classy5 Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted November 30, 2015 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;} Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted November 30, 2015 This can't be done with script alone, need source edits (moved to source request) Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted November 30, 2015 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... 1 AnnieRuru reacted to this Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted November 30, 2015 with plugin/source, one can add a time variable in item_data and can process each weapon separately...that would be interestingadd this in my to do list Quote Share this post Link to post Share on other sites
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 classy5Share this post
Link to post
Share on other sites