From 260fd90c0a9f3c71d138d367c9967dbad352a53c Mon Sep 17 00:00:00 2001 From: Christopher Date: Sat, 30 Jan 2021 05:58:42 +0000 Subject: [PATCH] =?UTF-8?q?=E2=80=9EChris.MultiNPC.lsl=E2=80=9C=20=C3=A4nd?= =?UTF-8?q?ern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Chris.MultiNPC.lsl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Chris.MultiNPC.lsl b/Chris.MultiNPC.lsl index 55ff31c..cc9eeeb 100644 --- a/Chris.MultiNPC.lsl +++ b/Chris.MultiNPC.lsl @@ -143,6 +143,19 @@ integer script_goto(integer slot, key npc, list command) return TRUE; } +integer script_appearance(integer slot, key npc, list command) +{ + if(llGetInventoryType(llList2String(command, 1) + ".appearance") != INVENTORY_NOTECARD) + { + llSay(0, "Cant find appearance '" + llList2String(command, 1) + "'."); + return FALSE; + } + + osNpcLoadAppearance(npc, llList2String(command, 1) + ".appearance"); + return TRUE; +} + + //Internal functions doNextScriptStep() { @@ -232,6 +245,10 @@ doNextScriptStep() if(script_goto(currentNPCSlot, currentNPCKey, lineCommandData)) currentNPCSlot--; break; + case "appearance": + if(script_appearance(currentNPCSlot, currentNPCKey, lineCommandData)) + currentNPCSlot--; + break; default: llSay(0, "Unknown command '" + llList2String(lineCommandData, 0) + "' in nc '"+ currentncname +"' on line '" + currentLine + "' failed."); }