2025/09/15 Update

Added creature template scripts.
Full compile.
This commit is contained in:
Jaysyn904
2025-09-15 08:31:22 -04:00
parent b4c7be2d81
commit 243ed8a652
9 changed files with 1347 additions and 0 deletions

View 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(){}