From d2b18c292a3a59f785a1eb27208f7379065f6317 Mon Sep 17 00:00:00 2001 From: L0ne_W0lf Date: Sat, 14 Aug 2010 16:06:23 +0000 Subject: * Quest log kill count now updated properly. (Added from topic 253813) * More battleground editing, and some bug fixes. - * ALL BATTLEGROUNDS ARE NOW ACTIVE BY DEFAULT. PLEASE CONTINUE TESTING * - Rewrote the Badge Exchange NPC in bg_common.txt, is official now. - Other changes to the bg_common folder, including disabled GM NPC. - Completely rewrote Flavius for the most part, from ground up. - Moved old Flavius battlegrounds to /custom/battleground folder. - Restored original bg_common, and KVM to /custom/battleground - Fixed wall bugs in Tierra Gorge, and added an oninit to the timers. - Other minor tweaks to both Tierra Gorge and KVM scripts. - Fixed the pseudo-cooldown on KVM not working properly, I hope. - Added global time2str function which will be used later in Endless tower. * Applied Epoque's mapflag clean up, which removes flags from scripts. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14374 54d463be-8e91-2dee-dedb-b68131a5f0ec --- npc/other/Global_Functions.txt | 36 ++++++++++++++++++++++++++++++++++++ npc/other/mail.txt | 21 --------------------- 2 files changed, 36 insertions(+), 21 deletions(-) (limited to 'npc/other') diff --git a/npc/other/Global_Functions.txt b/npc/other/Global_Functions.txt index cd18b3a22..18c384771 100644 --- a/npc/other/Global_Functions.txt +++ b/npc/other/Global_Functions.txt @@ -310,3 +310,39 @@ function script F_GetArmorType { } end; } + +// Time calculation Function +// ********************************************************************* +function script Time2Str { + set .@Time_Left, getarg(0) - gettimetick(2); + + set .@Days, .@Time_Left / 86400; + set .@Time_Left, .@Time_Left - (.@Days * 86400); + set .@Hours, .@Time_Left / 3600; + set .@Time_Left, .@Time_Left - (.@Hours * 3600); + set .@Minutes, .@Time_Left / 60; + set .@Time_Left, .@Time_Left - (.@Minutes * 60); + + set .@Time$, ""; + if( .@Days > 1 ) + set .@Time$, .@Time$ + .@Days + " days, "; + else if( .@Days > 0 ) + set .@Time$, .@Time$ + .@Days + " day, "; + + if( .@Hours > 1 ) + set .@Time$, .@Time$ + .@Hours + " hours, "; + else if( .@Hours > 0 ) + set .@Time$, .@Time$ + .@Hours + " hour, "; + + if( .@Minutes > 1 ) + set .@Time$, .@Time$ + .@Minutes + " minutes, "; + else if( .@Minutes > 0 ) + set .@Time$, .@Time$ + .@Minutes + " minute, "; + + if( .@Time_Left > 1 || .@Time_Left == 0 ) + set .@Time$, .@Time$ + .@Time_Left + " seconds."; + else if( .@Time_Left == 1 ) + set .@Time$, .@Time$ + .@Time_Left + " second."; + + return .@Time$; +} diff --git a/npc/other/mail.txt b/npc/other/mail.txt index 0ca900727..626efcb0b 100644 --- a/npc/other/mail.txt +++ b/npc/other/mail.txt @@ -21,27 +21,6 @@ // Allow Mail Inbox reading from //============================================================ -prontera mapflag town -izlude mapflag town -moc_ruins mapflag town -geffen mapflag town -payon mapflag town -pay_arche mapflag town -alberta mapflag town -aldebaran mapflag town -yuno mapflag town -lighthalzen mapflag town -einbroch mapflag town -einbech mapflag town -comodo mapflag town -umbala mapflag town -amatsu mapflag town -gonryun mapflag town -ayothaya mapflag town -louyang mapflag town -hugel mapflag town -rachel mapflag town -veins mapflag town // Prontera //============================================================ -- cgit v1.2.3-70-g09d2