2025/09/15 Update
Added creature template scripts. Full compile.
This commit is contained in:
50
_module/nss/npc_template_inc.nss
Normal file
50
_module/nss/npc_template_inc.nss
Normal file
@@ -0,0 +1,50 @@
|
||||
/* npc_template_inc
|
||||
|
||||
Common functions for Creature Templates
|
||||
|
||||
By: Jaysyn
|
||||
Created: 2024-11-14 08:27:30
|
||||
|
||||
*/
|
||||
#include "prc_inc_fork"
|
||||
#include "nw_inc_gff"
|
||||
#include "prc_inc_natweap"
|
||||
#include "prc_inc_util"
|
||||
|
||||
void ReallyEquipItemInSlot(object oNPC, object oItem, int nSlot);
|
||||
|
||||
void ReallyEquipItemInSlot(object oNPC, object oItem, int nSlot)
|
||||
{
|
||||
if (GetItemInSlot(nSlot) != oItem)
|
||||
{
|
||||
//ClearAllActions();
|
||||
AssignCommand(oNPC, ActionEquipItem(oItem, nSlot));
|
||||
DelayCommand(0.5, ReallyEquipItemInSlot(oNPC, oItem, nSlot));
|
||||
}
|
||||
}
|
||||
|
||||
// Get the size of a JSON array
|
||||
int GetJsonArraySize(json jArray)
|
||||
{
|
||||
int iSize = 0;
|
||||
while (JsonArrayGet(jArray, iSize) != JsonNull())
|
||||
{
|
||||
iSize++;
|
||||
}
|
||||
return iSize;
|
||||
}
|
||||
|
||||
int CheckForWeapon(object oCreature)
|
||||
{
|
||||
if (GetIsWeapon(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oCreature)) == 1 || GetIsWeapon(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oCreature)) == 1)
|
||||
{
|
||||
// oCreature has a weapon in at least one hand
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// oCreature doesn't have a weapon in either hand
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
//:: void main(){}
|
Reference in New Issue
Block a user