diff options
author | Dastgir <dastgirpojee@rocketmail.com> | 2015-07-20 18:26:25 +0530 |
---|---|---|
committer | Dastgir <dastgirpojee@rocketmail.com> | 2015-07-20 18:26:25 +0530 |
commit | 4cf80b1e5f29c7973576863e0c4eee809e561702 (patch) | |
tree | 46933e0bcff309b6457547fd8b56298281a9c338 /npc/other | |
parent | a7c771a064f5beb5c7f5f3c09a4ad744ac7c7ef5 (diff) | |
parent | 5aaf2707e25b8fa369bf37da1d51d0a0ee203473 (diff) | |
download | hercules-4cf80b1e5f29c7973576863e0c4eee809e561702.tar.gz hercules-4cf80b1e5f29c7973576863e0c4eee809e561702.tar.bz2 hercules-4cf80b1e5f29c7973576863e0c4eee809e561702.tar.xz hercules-4cf80b1e5f29c7973576863e0c4eee809e561702.zip |
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'npc/other')
-rw-r--r-- | npc/other/Global_Functions.txt | 27 | ||||
-rw-r--r-- | npc/other/auction.txt | 15 |
2 files changed, 37 insertions, 5 deletions
diff --git a/npc/other/Global_Functions.txt b/npc/other/Global_Functions.txt index 4e9060419..b88fa647a 100644 --- a/npc/other/Global_Functions.txt +++ b/npc/other/Global_Functions.txt @@ -39,10 +39,37 @@ //= 2.16 Added F_GetWeaponType, and F_GetArmorType. [L0ne_W0lf] //= 2.17 Renamed 'F_RandMes' to 'F_Rand'. [Euphy] //= 2.18 Removed useless 'getJobName' function. [Euphy] +//= 2.19 Improved 'F_InsertComma' function. [Emistry] //============================================================ ////////////////////////////////////////////////////////////////////////////////// +// Returns a number with commas based on precision of digits and custom separator. +// -- callfunc "F_InsertComma",<number>{,<precision>,<separator>} +// Examples: +// callfunc("F_InsertComma",7777777{,<precision>,<separator>}) // returns "7,777,777" +// callfunc("F_InsertComma",1000000000,3,","}) // returns "1,000,000,000" +// callfunc("F_InsertComma",1000000000,3,"_"}) // returns "1_000_000_000" +// callfunc("F_InsertComma",1000000000,4) // returns "10,0000,0000" +////////////////////////////////////////////////////////////////////////////////// +function script F_InsertComma { + .@value = getarg(0); + .@precision = getarg(1,3); + .@separator$ = getarg( 2,"," ); + + .@str$ = ""+.@value; + .@is_negative = ( .@value < 0 ); + + .@length = getstrlen( .@str$ ) - .@precision - .@is_negative; + while ( .@length > 0 ) { + .@str$ = insertchar( .@str$, .@separator$ , ( .@length + .@is_negative ) ); + .@length -= .@precision; + } + return .@str$; +} + + +////////////////////////////////////////////////////////////////////////////////// // Function that clears job quest variables ////////////////////////////////////////////////////////////////////////////////// diff --git a/npc/other/auction.txt b/npc/other/auction.txt index eb4eb7bc4..df76daa32 100644 --- a/npc/other/auction.txt +++ b/npc/other/auction.txt @@ -98,11 +98,16 @@ auction_02,43,17,0 warp auction_enterance_lhz 1,1,lighthalzen,209,169 next; if (select("Yes:No") == 1) { mes "[Auction Broker]"; - mes "Very well."; - mes "Please take"; - mes "a look, and see"; - mes "What's being offered~"; - openauction; + if ( getbattleflag( "feature.auction" ) ) { + mes "Very well."; + mes "Please take"; + mes "a look, and see"; + mes "What's being offered~"; + openauction; + } + else { + mes "Auction feature isn't enabled."; + } close; } mes "[Auction Broker]"; |