Azlier
Old World Ghost
- Reaction score
- 461
This snippet gives you the proper name of an integer below 100. Ex: 7 = "seven", 23 = "twenty three".
It just looks more polished for an NPC to say "Please, bring me seven chickens." rather than "Please, bring me 7 chickens." Best used with constant integers set at the top of your vJass quests and such. Works for GUI, too, though.
One function is available to you.
Yep, that's it. I'd have gone higher, but textmacros cannot be run from textmacros.
It just looks more polished for an NPC to say "Please, bring me seven chickens." rather than "Please, bring me 7 chickens." Best used with constant integers set at the top of your vJass quests and such. Works for GUI, too, though.
One function is available to you.
Yep, that's it. I'd have gone higher, but textmacros cannot be run from textmacros.
JASS:
library GetIntName initializer Init
//*****************
//* 0 - 100 pack *
//*****************
globals
private string array Names
private integer Count = 0
endglobals
constant function GetIntName takes integer i returns string
return Names<i>
endfunction
//! textmacro IntName__Set takes NAME
set Names[Count] = "$NAME$"
set Count = Count + 1
//! endtextmacro
//! textmacro IntName__SetTens takes NAME
set Names[Count] = "$NAME$"
set Count = Count + 1
set Names[Count] = "$NAME$-one"
set Count = Count + 1
set Names[Count] = "$NAME$-two"
set Count = Count + 1
set Names[Count] = "$NAME$-three"
set Count = Count + 1
set Names[Count] = "$NAME$-four"
set Count = Count + 1
set Names[Count] = "$NAME$-five"
set Count = Count + 1
set Names[Count] = "$NAME$-six"
set Count = Count + 1
set Names[Count] = "$NAME$-seven"
set Count = Count + 1
set Names[Count] = "$NAME$-eight"
set Count = Count + 1
set Names[Count] = "$NAME$-nine"
set Count = Count + 1
//! endtextmacro
private function Init takes nothing returns nothing
//! runtextmacro IntName__Set("zero")
//! runtextmacro IntName__Set("one")
//! runtextmacro IntName__Set("two")
//! runtextmacro IntName__Set("three")
//! runtextmacro IntName__Set("four")
//! runtextmacro IntName__Set("five")
//! runtextmacro IntName__Set("six")
//! runtextmacro IntName__Set("seven")
//! runtextmacro IntName__Set("eight")
//! runtextmacro IntName__Set("nine")
//! runtextmacro IntName__Set("ten")
//! runtextmacro IntName__Set("eleven")
//! runtextmacro IntName__Set("twelve")
//! runtextmacro IntName__Set("thirteen")
//! runtextmacro IntName__Set("fourteen")
//! runtextmacro IntName__Set("fifteen")
//! runtextmacro IntName__Set("sixteen")
//! runtextmacro IntName__Set("seventeen")
//! runtextmacro IntName__Set("eightteen")
//! runtextmacro IntName__Set("nineteen")
//! runtextmacro IntName__SetTens("twenty")
//! runtextmacro IntName__SetTens("thirty")
//! runtextmacro IntName__SetTens("forty")
//! runtextmacro IntName__SetTens("fifty")
//! runtextmacro IntName__SetTens("sixty")
//! runtextmacro IntName__SetTens("seventy")
//! runtextmacro IntName__SetTens("eighty")
//! runtextmacro IntName__SetTens("ninety")
//! runtextmacro IntName__Set("one hundred")
endfunction
endlibrary</i>