153 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetMemorisedSpellCountByLevel");
154 return GetMemorizedSpellCountByLevel(creature,
class, level);
159 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetMemorisedSpell");
161 spell.
domain = GetMemorizedSpellIsDomainSpell(creature,
class, level, index);
162 spell.meta = GetMemorizedSpellMetaMagic(creature,
class, level, index);
163 spell.ready = GetMemorizedSpellReady(creature,
class, level, index);
164 spell.id = GetMemorizedSpellId(creature,
class, level, index);
170 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Creature_SetMemorisedSpell");
171 SetMemorizedSpell(creature,
class, level, index, spell.
id, spell.
ready, spell.
meta, spell.
domain);
176 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetKnownSpellCount");
177 return GetKnownSpellCount(creature,
class, level);
182 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetKnownSpell");
183 return GetKnownSpellId(creature,
class, level, index);
188 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Creature_ClearMemorisedKnownSpells");
189 ClearMemorizedSpellBySpellId(creature,
class, spellId);
194 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Creature_ClearMemorisedSpell");
195 ClearMemorizedSpell(creature,
class, level, index);
200 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetSoundset");
201 return GetSoundset(creature);
206 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Creature_SetSoundset");
207 SetSoundset(creature, soundset);
212 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Creature_SetGender");
213 SetGender(creature, gender);
218 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Creature_RestoreSpells");
222 for (i = 0; i < 10; i++)
224 ReadySpellLevel(creature, i);
228 ReadySpellLevel(creature, level);
234 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetDomain");
235 return GetDomain(creature, index,
class);
240 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetSpecialization");
241 return GetSpecialization(creature,
class);
246 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetSpellUsesLeft");
247 return GetSpellUsesLeft(oCreature, GetClassByPosition(nMultiClass + 1), nSpellID, nMetaMagic, nDomainLevel);
252 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Creature_GetMemorizedSpellReadyCount");
253 return GetSpellUsesLeft(oCreature, GetClassByPosition(nMultiClass + 1), nSpellID, nMetaMagic);
258 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Creature_SetEffectIconFlashing");
259 SetEffectIconFlashing(oCreature, nIconId, bFlashing);
290 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Effect_SetEffectExpiredScript");
291 return EffectLinkEffects(EffectRunScript(
"", script,
"", 0.0f, data), e);
296 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Effect_GetEffectExpiredData");
297 return GetEffectString(GetLastRunScriptEffect(), 0);
302 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Effect_GetEffectExpiredCreator");
303 return GetEffectCreator(GetLastRunScriptEffect());
308 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Effect_AccessorizeVisualEffect");
309 if (GetEffectType(eEffect) == EFFECT_TYPE_VISUALEFFECT)
310 return UnyieldingEffect(eEffect);
353 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Object_StringToObject");
354 return StringToObject(
id);
359 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Object_CheckFit");
360 return GetBaseItemFitsInInventory(baseitem, obj);
365 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Object_AddIconEffect");
366 effect eEffect = GetFirstEffect(obj);
367 while (GetIsEffectValid(eEffect))
369 if (GetEffectTag(eEffect) ==
"NWNX_Object_IconEffect" && GetEffectInteger(eEffect, 0) == nIcon)
370 RemoveEffect(obj, eEffect);
371 eEffect = GetNextEffect(obj);
374 effect eIcon = TagEffect(SupernaturalEffect(EffectIcon(nIcon)),
"NWNX_Object_IconEffect");
375 ApplyEffectToObject(fDuration == 0.0 ? DURATION_TYPE_PERMANENT : DURATION_TYPE_TEMPORARY, eIcon, obj, fDuration);
380 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Object_RemoveIconEffect");
381 effect eEffect = GetFirstEffect(obj);
382 while (GetIsEffectValid(eEffect))
384 if (GetEffectTag(eEffect) ==
"NWNX_Object_IconEffect" && GetEffectInteger(eEffect, 0) == nIcon)
385 RemoveEffect(obj, eEffect);
386 eEffect = GetNextEffect(obj);
392 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Object_SetFacing");
393 AssignCommand(oObject, SetFacing(fDirection));
409 string NWNX_Regex_Replace(
string str,
string regex,
string replace =
"",
int firstOnly = FALSE);
419 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Regex_Search");
420 return JsonGetLength(RegExpMatch(regex, str));
425 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Regex_Replace");
426 return RegExpReplace(regex, str, replace, firstOnly ? REGEXP_FORMAT_FIRST_ONLY : REGEXP_FORMAT_DEFAULT);
431 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Regex_Match");
432 return RegExpIterate(regex, str);
462 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Util_IsValidResRef");
463 return ResManGetAliasFor(resref, type) !=
"";
468 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Util_Get2DARowCount");
469 return Get2DARowCount(str);
474 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Util_GetNSSContents");
475 string s = ResManGetFileContents(sScriptName, RESTYPE_NSS);
476 return nMaxLength == -1 ? s : GetStringLeft(s, nMaxLength);
481 WriteTimestampedLogEntry(
"WARNING: Calling deprecated NWNX Function: NWNX_Util_GetServerTicksPerSecond");
482 return GetTickRate();
void NWNX_Creature_ClearMemorisedKnownSpells(object creature, int class, int spellId)
Clear a specific spell from the creature's spellbook for class.
int NWNX_Creature_GetSpecialization(object creature, int class)
Gets the creature's specialist school.
int NWNX_Creature_GetKnownSpellCount(object creature, int class, int level)
Gets the known spell count (innate casting) at a class level.
const int NWNX_CREATURE_CLERIC_DOMAIN_TRICKERY
json NWNX_Regex_Match(string str, string regex)
Returns all matches in a string that match the regular expression.
void NWNX_Creature_SetEffectIconFlashing(object oCreature, int nIconId, int bFlashing)
Set whether an effect icon is flashing or not.
void NWNX_Creature_SetSoundset(object creature, int soundset)
Set the soundset index for creature.
void NWNX_Creature_SetMemorisedSpell(object creature, int class, int level, int index, struct NWNX_Creature_MemorisedSpell spell)
Sets the memorised spell at a class level's index.
const int NWNX_CREATURE_CLERIC_DOMAIN_GOOD
int NWNX_Creature_GetSpellUsesLeft(object oCreature, int nSpellID, int nMultiClass, int nDomainLevel=0, int nMetaMagic=METAMAGIC_NONE)
Get the number of uses left of a spell.
effect NWNX_Effect_SetEffectExpiredScript(effect e, string script, string data="")
Set a script with optional data that runs when an effect expires.
void NWNX_Creature_ClearMemorisedSpell(object creature, int class, int level, int index)
Clear the memorised spell of the creature for the class, level and index.
const int NWNX_CREATURE_CLERIC_DOMAIN_STRENGTH
const int NWNX_CREATURE_CLERIC_DOMAIN_FIRE
const int NWNX_CREATURE_CLERIC_DOMAIN_SUN
int NWNX_Creature_GetMemorizedSpellReadyCount(object oCreature, int nSpellID, int nMultiClass, int nMetaMagic=METAMAGIC_NONE)
Get the number of memorized ready spells by spellid.
const int NWNX_CREATURE_CLERIC_DOMAIN_DEATH
string NWNX_Util_GetNSSContents(string sScriptName, int nMaxLength=-1)
Gets the contents of a .nss script file as a string.
const int NWNX_CREATURE_CLERIC_DOMAIN_TRAVEL
int NWNX_Regex_Search(string str, string regex)
const int NWNX_CREATURE_CLERIC_DOMAIN_KNOWLEDGE
void NWNX_Object_AddIconEffect(object obj, int nIcon, float fDuration=0.0)
Add an effect to an object that displays an icon and has no other effect.
const int NWNX_CREATURE_CLERIC_DOMAIN_ANIMAL
const int NWNX_CREATURE_CLERIC_DOMAIN_WAR
int NWNX_Creature_GetKnownSpell(object creature, int class, int level, int index)
Gets the known spell at a class level's index.
object NWNX_Object_StringToObject(string id)
Convert an object id to the actual object.
void NWNX_Creature_RestoreSpells(object creature, int level=-1)
Restore all creature spells per day for given level.
int NWNX_Creature_GetMemorisedSpellCountByLevel(object creature, int class, int level)
Gets the count of memorised spells for a creature's class at a level.
const int NWNX_CREATURE_CLERIC_DOMAIN_PROTECTION
const int NWNX_CREATURE_CLERIC_DOMAIN_AIR
const int NWNX_CREATURE_CLERIC_DOMAIN_HEALING
object NWNX_Effect_GetEffectExpiredCreator()
Get the effect creator.
void NWNX_Object_RemoveIconEffect(object obj, int nIcon)
Remove an icon effect from an object that was added by the NWNX_Object_AddIconEffect() function.
int NWNX_Creature_GetSoundset(object creature)
Get the soundset index for creature.
int NWNX_Util_IsValidResRef(string resref, int type=RESTYPE_UTC)
Determines if the supplied resref exists.
const int NWNX_CREATURE_CLERIC_DOMAIN_DESTRUCTION
string NWNX_Effect_GetEffectExpiredData()
Get the data set with NWNX_Effect_SetEffectExpiredScript()
const int NWNX_CREATURE_CLERIC_DOMAIN_MAGIC
struct NWNX_Creature_MemorisedSpell NWNX_Creature_GetMemorisedSpell(object creature, int class, int level, int index)
Gets the memorised spell at a class level's index.
int NWNX_Util_GetServerTicksPerSecond()
Get the ticks per second of the server.
const int NWNX_CREATURE_CLERIC_DOMAIN_EARTH
int NWNX_Object_CheckFit(object obj, int baseitem)
Check if an item can fit in an object's inventory.
const int NWNX_CREATURE_CLERIC_DOMAIN_EVIL
int NWNX_Creature_GetDomain(object creature, int class, int index)
Gets one of creature's domains.
const int NWNX_CREATURE_CLERIC_DOMAIN_PLANT
int NWNX_Util_Get2DARowCount(string str)
Gets the row count for a 2da.
string NWNX_Regex_Replace(string str, string regex, string replace="", int firstOnly=FALSE)
Replaces any matches of the regular expression with a string.
void NWNX_Creature_SetGender(object creature, int gender)
Sets the creature gender.
effect NWNX_Effect_AccessorizeVisualEffect(effect eEffect)
Accessorize an EffectVisualEffect(), making it undispellable and unable to be removed by resting or d...
void NWNX_Object_SetFacing(object oObject, float fDirection)
Cause oObject to face fDirection.
const int NWNX_CREATURE_CLERIC_DOMAIN_WATER
A memorised spell structure.
int meta
Metamagic type, if any.
int domain
Clerical domain, if any.
int ready
Whether the spell can be cast.