Files
PRC8/nwn/nwnprc/trunk/newspellbook/moi_incarnate.nss
Jaysyn904 f397206b74 2026/04/27 Update
Fighter was missing Weapon Proficiency: Scythe.
Tentative fix for Sweeping Strike + Eldritch Glaive.
Fixed Necrocarnum Weapon reducing AB.
Updated creature abilities to more closely follow PnP.
Updated tlk for Sanctified & Holy Ki Strike.
2026-04-27 10:31:20 -04:00

60 lines
2.2 KiB
Plaintext

#include "moi_inc_moifunc"
#include "inc_dynconv"
// Add this function to handle delayed processing
void DelayedChakraBindUnequip(object oMeldshaper, object oItem)
{
// Check if we're still in a valid state
if(GetIsObjectValid(oMeldshaper) && GetIsObjectValid(oItem))
{
ChakraBindUnequip(oMeldshaper, oItem);
}
}
void main()
{
int nEvent = GetRunningEvent();
if(DEBUG) DoDebug("moi_incarnate running, event: " + IntToString(nEvent));
// Get the PC. This is event-dependent
object oMeldshaper;
switch(nEvent)
{
case EVENT_ONPLAYERREST_FINISHED: oMeldshaper = GetLastBeingRested(); break;
case EVENT_ONCLIENTENTER: oMeldshaper = GetEnteringObject(); break;
case EVENT_ONPLAYEREQUIPITEM: oMeldshaper = GetItemLastEquippedBy(); break;
default:
oMeldshaper = OBJECT_SELF;
}
if (!GetLocalInt(oMeldshaper, "IncarnateDelay"))
{
SetLocalInt(oMeldshaper, "IncarnateDelay", TRUE);
DelayCommand(0.1, DeleteLocalInt(oMeldshaper, "IncarnateDelay"));
int nClass = GetLevelByClass(CLASS_TYPE_INCARNATE, oMeldshaper);
object oSkin = GetPCSkin(oMeldshaper);
// We aren't being called from any event, instead from EvalPRCFeats
if(nEvent == FALSE)
{
//DoDebug("moi_incarnate Event False");
// Add eventhook to OnRestFinished to reset the used marker
AddEventScript(oMeldshaper, EVENT_ONPLAYERREST_FINISHED, "moi_incarnate", TRUE, TRUE);
AddEventScript(oMeldshaper, EVENT_ONPLAYEREQUIPITEM, "moi_incarnate", TRUE, TRUE);
}
else if(nEvent == EVENT_ONPLAYERREST_FINISHED && IncarnateAlignment(oMeldshaper) && (PRCGetIsAliveCreature(oMeldshaper)|| GetHasFeat(FEAT_UNDEAD_MELDSHAPER, oMeldshaper)))
{
ClearMeldShapes(oMeldshaper);
AssignCommand(oMeldshaper, ClearAllActions(TRUE));
SetLocalInt(oMeldshaper, "MeldshapeClass", CLASS_TYPE_INCARNATE);
StartDynamicConversation("moi_meldshapecnv", oMeldshaper, DYNCONV_EXIT_NOT_ALLOWED, FALSE, TRUE, oMeldshaper);
}
else if(nEvent == EVENT_ONPLAYEREQUIPITEM)
{
oMeldshaper = GetItemLastEquippedBy();
ChakraBindUnequip(oMeldshaper, GetItemLastEquipped());
}
}
}