summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-03-03 22:25:17 -0300
committerJesusaves <cpntb1@ymail.com>2019-03-03 22:25:17 -0300
commit8af4322591e409db4bff79ed5ea3f9ce5459bcb7 (patch)
tree3a48fcdf6657f42fe581d8484043ef166b7ae515
parent7d56f5faddfa75d5a35d3bcb0e27d5069e26d073 (diff)
downloadserverdata-8af4322591e409db4bff79ed5ea3f9ce5459bcb7.tar.gz
serverdata-8af4322591e409db4bff79ed5ea3f9ce5459bcb7.tar.bz2
serverdata-8af4322591e409db4bff79ed5ea3f9ce5459bcb7.tar.xz
serverdata-8af4322591e409db4bff79ed5ea3f9ce5459bcb7.zip
Implement get_race() - this will return player race in a human readable form.
Useful when you want to say "hey, human." but is not aware of player race.
-rw-r--r--npc/functions/main.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/npc/functions/main.txt b/npc/functions/main.txt
index b620be0c..c5fffa6c 100644
--- a/npc/functions/main.txt
+++ b/npc/functions/main.txt
@@ -199,6 +199,25 @@ function script npctalkonce {
return true;
}
+// Returns the human-readable race for a Class ID
+// Will default to player race if no argument is passed.
+// Works without a player attached, but argument must then be passed.
+// get_race( {Class} )
+function script get_race {
+ .@g=getarg(0, Class);
+ if (playerattached())
+ {
+ setarray .@allraces$, l("Human"), l("Ukar"), l("Fire Kralog"),
+ l("Light Raijin"), l("Frost Kralog"), l("Dark Raijin"), l("Tritan");
+ }
+ else
+ {
+ setarray .@allraces$, "Human", "Ukar", "Fire Kralog", "Light Raijin",
+ "Frost Kralog", "Dark Raijin", "Tritan";
+ }
+ return .@allraces$[.@g];
+}
+
function script getquestlink {
return "[@@q" + getarg(0) + "|@@]";
}