From f0bb6f6af0d05e67af0d827d1d3b1fe160d5e05e Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 24 Jun 2019 09:31:04 -0300 Subject: Rewrite Taree to use a function --- npc/003-1/taree.txt | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'npc') diff --git a/npc/003-1/taree.txt b/npc/003-1/taree.txt index 2980140f0..f45e89481 100644 --- a/npc/003-1/taree.txt +++ b/npc/003-1/taree.txt @@ -4,14 +4,19 @@ // Description: // Mouboo Renting (var MOUBOO_RENTTIME ) -003-1,63,31,0 script Taree NPC_ELVEN_MAN_MOUBOO_SHOP,{ - if (MOUBOO_RENTTIME > gettimetick(2)) - goto L_Rented; +// MoubooRent( NPC Name ) +function script MoubooRent { + .@n$=getarg(0, strnpcinfo(0)); + if (MOUBOO_RENTTIME > gettimetick(2)) { + mesn .@n$; + mesq l("Moo!"); + return; + } - mesn; + mesn .@n$; mesq l("Moo!"); next; - mesn; + mesn .@n$; mesq l("Do you want to rent a Mouboo? It allows quick traveling!"); next; menuint @@ -24,7 +29,7 @@ mes ""; switch (@menuret) { case 0: - close; + return; case 100: .@time=86400; break; case 270: @@ -43,11 +48,13 @@ MOUBOO_RENTTIME=gettimetick(2)+.@time; Zeny-=@menuret; rentitem RidingMouboo, .@time; - close; + return; +} -L_Rented: - mesn; - mesq l("Moo!"); +003-1,63,31,0 script Taree NPC_ELVEN_MAN_MOUBOO_SHOP,{ + MoubooRent(); + closeclientdialog; + goodbye(); close; OnInit: -- cgit v1.2.3-60-g2f50