From e0ac7e9176fb0041d87ea519d28e2ebf5049ef91 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 26 Apr 2019 12:26:14 +0000 Subject: 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 --- npc/commands/debug-look.txt | 4 ++-- npc/functions/util.txt | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) (limited to 'npc') 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]; + +} -- cgit v1.2.3-70-g09d2