add npc commands
This commit is contained in:
parent
6ed4b1c5e0
commit
6d5ac839af
|
@ -197,6 +197,48 @@ integer script_appearance(integer slot, key npc, list command)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
integer script_animation(integer slot, key npc, list command)
|
||||
{
|
||||
if(llGetInventoryType(llList2String(command, 1)) != INVENTORY_ANIMATION)
|
||||
{
|
||||
llSay(0, "Cant find animation '" + llList2String(command, 1) + "'.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
osNpcPlayAnimation(npc, llList2String(command, 1));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
integer script_StopAnimation(integer slot, key npc, list command)
|
||||
{
|
||||
if(llGetInventoryType(llList2String(command, 1)) != INVENTORY_ANIMATION)
|
||||
{
|
||||
llSay(0, "Cant find animation '" + llList2String(command, 1) + "'.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
osNpcStopAnimation(npc, llList2String(command, 1));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
integer script_profileImage(integer slot, key npc, list command)
|
||||
{
|
||||
if(llGetInventoryType(llList2String(command, 1)) != INVENTORY_TEXTURE)
|
||||
{
|
||||
llSay(0, "Cant find image '" + llList2String(command, 1) + "'.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
osNpcSetProfileImage(npc, llList2String(command, 1));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
integer script_profileText(integer slot, key npc, list command)
|
||||
{
|
||||
osNpcSetProfileAbout(npc, llList2String(command, 1));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
integer script_include(integer slot, key npc, list command)
|
||||
{
|
||||
if(llGetInventoryType(llList2String(command, 1) + ".path") != INVENTORY_NOTECARD)
|
||||
|
@ -323,6 +365,22 @@ doNextScriptStep()
|
|||
if(script_appearance(currentNPCSlot, currentNPCKey, lineCommandData))
|
||||
currentNPCSlot--;
|
||||
break;
|
||||
case "animation":
|
||||
if(!script_animation(currentNPCSlot, currentNPCKey, lineCommandData))
|
||||
llSay(0, "Script execution in '" + llList2String(lineCommandData, 0) + "' in nc '"+ currentncname +"' on line '" + currentLine + "' failed.");
|
||||
break;
|
||||
case "stopAnimation":
|
||||
if(!script_StopAnimation(currentNPCSlot, currentNPCKey, lineCommandData))
|
||||
llSay(0, "Script execution in '" + llList2String(lineCommandData, 0) + "' in nc '"+ currentncname +"' on line '" + currentLine + "' failed.");
|
||||
break;
|
||||
case "profileImage":
|
||||
if(!script_profileImage(currentNPCSlot, currentNPCKey, lineCommandData))
|
||||
llSay(0, "Script execution in '" + llList2String(lineCommandData, 0) + "' in nc '"+ currentncname +"' on line '" + currentLine + "' failed.");
|
||||
break;
|
||||
case "profileText":
|
||||
if(!script_profileText(currentNPCSlot, currentNPCKey, lineCommandData))
|
||||
llSay(0, "Script execution in '" + llList2String(lineCommandData, 0) + "' in nc '"+ currentncname +"' on line '" + currentLine + "' failed.");
|
||||
break;
|
||||
default:
|
||||
llSay(0, "Unknown command '" + llList2String(lineCommandData, 0) + "' in nc '"+ currentncname +"' on line '" + currentLine + "' failed.");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue