diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-04-26 12:26:14 +0000 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-04-26 12:26:14 +0000 |
commit | e0ac7e9176fb0041d87ea519d28e2ebf5049ef91 (patch) | |
tree | aa10f65d7d94315a9ff4e9c7e19189729ef4e874 /npc | |
parent | 4d06e3796632e6200d5ec8cf0b5266347ff9d6bf (diff) | |
download | serverdata-e0ac7e9176fb0041d87ea519d28e2ebf5049ef91.tar.gz serverdata-e0ac7e9176fb0041d87ea519d28e2ebf5049ef91.tar.bz2 serverdata-e0ac7e9176fb0041d87ea519d28e2ebf5049ef91.tar.xz serverdata-e0ac7e9176fb0041d87ea519d28e2ebf5049ef91.zip |
Address race concerns of evol-all#35 because I wanted something pretty.
I know I am wasting time. @WildX will probably agree, too. But meh.
This outlines server-side how races may work and thus, includes get_race() function
making !156 deprecated
Diffstat (limited to 'npc')
-rw-r--r-- | npc/commands/debug-look.txt | 4 | ||||
-rw-r--r-- | npc/functions/util.txt | 36 |
2 files changed, 38 insertions, 2 deletions
diff --git a/npc/commands/debug-look.txt b/npc/commands/debug-look.txt index 79bf8699..4ab9ed44 100644 --- a/npc/commands/debug-look.txt +++ b/npc/commands/debug-look.txt @@ -41,7 +41,7 @@ function script BarberDebug { function setRace { clear; setnpcdialogtitle l("Appearance Debug - Race"); - mes l("Race") + ": " + Class; + mes l("Race") + ": " + Class + " (" + get_race(GETRACE_FULL) + ")"; next; mes l("Please enter the desired race") + " (0-32767)"; input .@r, 0, 0x7FFF; @@ -60,7 +60,7 @@ function script BarberDebug { mes l("Gender") + ": " + Sex; mes l("Hair style") + ": " + getlook(LOOK_HAIR); mes l("Hair color") + ": " + getlook(LOOK_HAIR_COLOR); - mes l("Race") + ": " + Class; + mes l("Race") + ": " + Class + " (" + get_race() + ")";; mes "---"; next; diff --git a/npc/functions/util.txt b/npc/functions/util.txt index 2cb28573..d5fe8bc4 100644 --- a/npc/functions/util.txt +++ b/npc/functions/util.txt @@ -73,4 +73,40 @@ function script getmap { return .@mapName$; } +// Returns the player race in plain text +// GETRACE_RACE - returns player race (default) +// GETRACE_SKIN - returns player skin +// GETRACE_FULL - returns player skin + race +// Can take an optional 2nd param with the class +// get_race( {Flag, {Class}} ) +function script get_race { + .@m=getarg(0, GETRACE_RACE); + .@g=getarg(1, Class); + + // We also allow this to run without player attached for... science. + if (getarg(1,-1) >= 0) + { + setarray .@allraces$, l("Human"), l("Ukar"), l("Kralog"), + l("Raijin"), l("Kralog"), l("Raijin"), l("Tritan"), + l("Human"), l("Human"), l("Tritan"), l("Ukar"); + setarray .@allskins$, l("Kaizei"), l("Cave"), l("Fire"), + l("Light"), l("Frost"), l("Dark"), l("Sea"), l("Argaes"), + l("Tonori"), l("Lake"), l("Mountain"); + } + else + { + setarray .@allraces$, "Human", "Ukar", "Kralog", "Raijin", + "Kralog", "Raijin", "Tritan", "Human", "Human", "Tritan", "Ukar"; + setarray .@allskins$, "Kaizei", "Cave", "Fire", "Light", + "Frost", "Dark", "Sea", "Argaes", "Tonori", "Lake", "Mountain"; + } + + if (.@m == GETRACE_RACE) + return .@allraces$[.@g]; + else if (.@m == GETRACE_SKIN) + return .@allskins$[.@g]; + else + return .@allskins$[.@g] + " " + .@allraces$[.@g]; + +} |