Added creatures & models
Added creatures, portraits & models in support of Horsefly Swamp Update.
This commit is contained in:
202
_module/nss/_inc_battlecry_.nss
Normal file
202
_module/nss/_inc_battlecry_.nss
Normal file
@@ -0,0 +1,202 @@
|
||||
///////////////////////////////////
|
||||
// Carcerian's BattleCry Script //
|
||||
// "Evil Dead" Edition //
|
||||
///////////////////////////////////
|
||||
|
||||
#include "NW_I0_GENERIC"
|
||||
#include "prc_inc_racial"
|
||||
|
||||
const int BattleCryChance = 15;
|
||||
const int CombatCryChance = 20;
|
||||
const int DeathCryChance = 20;
|
||||
const int CustomUndeadChance = 50;
|
||||
const int CommerTalkChance = 50;
|
||||
|
||||
const string COLOR_RED = "<c<> >";
|
||||
const string COLOR_DARK = "<cSSS>";
|
||||
const string COLOR_GREEN = "<c <20> >";
|
||||
const string COLOR_WHITE = "<c<><63><EFBFBD>>";
|
||||
const string COLOR_VIOLET = "<c<> <20>>";
|
||||
const string COLOR_YELLOW = "<c<><63> >";
|
||||
|
||||
int HasSpoken()
|
||||
{
|
||||
if (GetLocalInt(OBJECT_SELF,"HASSPOKEN")) return 1;
|
||||
SetLocalInt(OBJECT_SELF,"HASSPOKEN",1);
|
||||
DelayCommand(IntToFloat(d10(4)),SetLocalInt(OBJECT_SELF,"HASSPOKEN",0));
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DoUndeadChatter()
|
||||
{
|
||||
string sMyTag = GetTag(OBJECT_SELF);
|
||||
if ((FindSubString(sMyTag,"SKEL")>-1)||(FindSubString(sMyTag,"MOHRG")>-1))
|
||||
{
|
||||
switch (d3()) // Skeletons
|
||||
{
|
||||
case 1 : ActionSpeakString(COLOR_WHITE+"I got a bone to pick with you!",TALKVOLUME_TALK); break;
|
||||
case 2 : ActionSpeakString(COLOR_WHITE+"Forward, you worthless bags of bones!",TALKVOLUME_TALK); break;
|
||||
case 3 : ActionSpeakString(COLOR_WHITE+"CHARGE!",TALKVOLUME_TALK); break;
|
||||
}
|
||||
}
|
||||
else if (FindSubString(sMyTag,"ZOMB")>-1)
|
||||
{
|
||||
if (Random(2)) ActionSpeakString(COLOR_GREEN+"Brains!",TALKVOLUME_TALK);
|
||||
else ActionSpeakString(COLOR_GREEN+"BRAINS!",TALKVOLUME_TALK);
|
||||
// "More brains!"
|
||||
}
|
||||
else if ((FindSubString(sMyTag,"GHOUL")>-1)||(FindSubString(sMyTag,"GHAST")>-1)
|
||||
||(FindSubString(sMyTag,"WIGHT")>-1))
|
||||
{
|
||||
switch (d4()) // Flesh Eaters
|
||||
{
|
||||
case 1 : ActionSpeakString(COLOR_GREEN+"I'll feast on your entrails!",TALKVOLUME_TALK); break;
|
||||
case 2 : ActionSpeakString(COLOR_GREEN+"FOOD!",TALKVOLUME_TALK); break;
|
||||
case 3 : ActionSpeakString(COLOR_GREEN+"Live ones!!",TALKVOLUME_TALK); break;
|
||||
case 4 : ActionSpeakString(COLOR_GREEN+"FLESSSSHHHH!!!",TALKVOLUME_TALK); break;
|
||||
}
|
||||
}
|
||||
else if ((FindSubString(sMyTag,"WRAITH")>-1)||(FindSubString(sMyTag,"ALLIP")>-1)
|
||||
||(FindSubString(sMyTag,"Bodak")>-1)||(FindSubString(sMyTag,"SHADOW")>-1)
|
||||
||(FindSubString(sMyTag,"SHFIEND")>-1)||(FindSubString(sMyTag,"SPECTRE")>-1))
|
||||
{
|
||||
switch (d4()) // Soul Eaters
|
||||
{
|
||||
case 1 : ActionSpeakString(COLOR_VIOLET+"I'll swallow your soul!",TALKVOLUME_TALK); break;
|
||||
case 2 : ActionSpeakString(COLOR_VIOLET+"Your soul will be mine!",TALKVOLUME_TALK); break;
|
||||
case 3 : ActionSpeakString(COLOR_VIOLET+"Mine!!!!",TALKVOLUME_TALK); break;
|
||||
case 4 : ActionSpeakString(COLOR_VIOLET+"The darkness calls for you...",TALKVOLUME_TALK); break;
|
||||
}
|
||||
}
|
||||
else switch (d6()) // Generic Undead
|
||||
{
|
||||
case 1 : ActionSpeakString(COLOR_RED+"I'll swallow your soul!",TALKVOLUME_TALK); break;
|
||||
case 2 : ActionSpeakString(COLOR_RED+"Blood and souls!",TALKVOLUME_TALK); break;
|
||||
case 3 : ActionSpeakString(COLOR_RED+"Joinnnn usssssssss!",TALKVOLUME_TALK); break;
|
||||
case 4 : ActionSpeakString(COLOR_RED+"For the Master!",TALKVOLUME_TALK); break;
|
||||
case 5 : ActionSpeakString(COLOR_RED+"For the Master!",TALKVOLUME_TALK); break;
|
||||
case 6 : ActionSpeakString(COLOR_RED+"One by one we will take you!",TALKVOLUME_TALK); break;
|
||||
}
|
||||
}
|
||||
|
||||
// For use on perception
|
||||
void DoBattleCry()
|
||||
{
|
||||
int iClass1 = GetClassByPosition(1, OBJECT_SELF);
|
||||
|
||||
//if undead spotted "i see dead people!" "Dead ahead!"
|
||||
if (d100()<=BattleCryChance)
|
||||
{
|
||||
if (HasSpoken()) return;
|
||||
if ((MyPRCGetRacialType(OBJECT_SELF) == RACIAL_TYPE_UNDEAD)&&(d100()<=CustomUndeadChance))
|
||||
{
|
||||
DoUndeadChatter();
|
||||
}
|
||||
if ((iClass1 = 20) && (d100()<=CommerTalkChance))
|
||||
{
|
||||
switch (d6())
|
||||
{
|
||||
case 1: PlayVoiceChat(VOICE_CHAT_HELLO); break;
|
||||
case 2: PlayVoiceChat(VOICE_CHAT_LAUGH); break;
|
||||
case 3: PlayVoiceChat(VOICE_CHAT_SELECTED); break;
|
||||
case 4: PlayVoiceChat(VOICE_CHAT_TALKTOME); break;
|
||||
case 5: PlayVoiceChat(VOICE_CHAT_GOODBYE); break;
|
||||
case 6: PlayVoiceChat(VOICE_CHAT_HELLO); break;
|
||||
}
|
||||
}
|
||||
else switch (d10())
|
||||
{
|
||||
case 1: PlayVoiceChat(VOICE_CHAT_ATTACK); break;
|
||||
case 2: PlayVoiceChat(VOICE_CHAT_BATTLECRY1); break;
|
||||
case 3: PlayVoiceChat(VOICE_CHAT_BATTLECRY2); break;
|
||||
case 4: PlayVoiceChat(VOICE_CHAT_BATTLECRY3); break;
|
||||
case 5: PlayVoiceChat(VOICE_CHAT_THREATEN); break;
|
||||
case 6: PlayVoiceChat(VOICE_CHAT_TAUNT); break;
|
||||
case 7: PlayVoiceChat(VOICE_CHAT_ENEMIES); break;
|
||||
case 8: PlayVoiceChat(VOICE_CHAT_CHEER); break;
|
||||
case 9: PlayVoiceChat(VOICE_CHAT_FOLLOWME); break;
|
||||
case 10: PlayVoiceChat(VOICE_CHAT_LOOKHERE); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//For End of Combat Round
|
||||
void DoCombatCry()
|
||||
{
|
||||
if (GetHasEffect(EFFECT_TYPE_FRIGHTENED))
|
||||
{
|
||||
if (d100()<=CombatCryChance)
|
||||
{
|
||||
if (HasSpoken()) return;
|
||||
if ((MyPRCGetRacialType(OBJECT_SELF) == RACIAL_TYPE_UNDEAD)&&(d100()<=CustomUndeadChance))
|
||||
switch (d6()) //Turned undead :)
|
||||
{
|
||||
case 1 : ActionSpeakString(COLOR_YELLOW+"It Burns! It Burns!",TALKVOLUME_TALK); break;
|
||||
case 2 : ActionSpeakString(COLOR_YELLOW+"Cursed Light!",TALKVOLUME_TALK); break;
|
||||
case 3 : ActionSpeakString(COLOR_YELLOW+"Your faith is weak, I can feel your fear...",TALKVOLUME_TALK); break;
|
||||
case 4 : ActionSpeakString(COLOR_YELLOW+"AAAIIIEEE!!!",TALKVOLUME_TALK); break;
|
||||
case 5 : ActionSpeakString(COLOR_YELLOW+"NOOO!!!",TALKVOLUME_TALK); break;
|
||||
case 6 : ActionSpeakString(COLOR_YELLOW+"It Burns!",TALKVOLUME_TALK); break;
|
||||
}
|
||||
else switch (d6())
|
||||
{
|
||||
case 1: PlayVoiceChat(VOICE_CHAT_FLEE); break;
|
||||
case 2: PlayVoiceChat(VOICE_CHAT_HELP); break;
|
||||
case 3: PlayVoiceChat(VOICE_CHAT_GUARDME); break;
|
||||
case 4: PlayVoiceChat(VOICE_CHAT_CUSS); break;
|
||||
case 5: PlayVoiceChat(VOICE_CHAT_BADIDEA); break;
|
||||
case 6: PlayVoiceChat(VOICE_CHAT_NEARDEATH); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (d100()<=CombatCryChance)
|
||||
{
|
||||
if (HasSpoken()) return;
|
||||
if ((MyPRCGetRacialType(OBJECT_SELF) == RACIAL_TYPE_UNDEAD)&&(d100()<=CustomUndeadChance))
|
||||
switch (d6())
|
||||
{
|
||||
DoUndeadChatter();
|
||||
}
|
||||
else switch (d6())
|
||||
{
|
||||
case 1: PlayVoiceChat(VOICE_CHAT_BATTLECRY1); break;
|
||||
case 2: PlayVoiceChat(VOICE_CHAT_BATTLECRY2); break;
|
||||
case 3: PlayVoiceChat(VOICE_CHAT_BATTLECRY3); break;
|
||||
case 4: PlayVoiceChat(VOICE_CHAT_LAUGH); break;
|
||||
case 5: PlayVoiceChat(VOICE_CHAT_TAUNT); break;
|
||||
case 6: PlayVoiceChat(VOICE_CHAT_THREATEN); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//For Creature Death
|
||||
void DoDeathCry()
|
||||
{
|
||||
if (d100()<=DeathCryChance)
|
||||
{
|
||||
if (HasSpoken()) return;
|
||||
if ((MyPRCGetRacialType(OBJECT_SELF) == RACIAL_TYPE_UNDEAD)&&(d100()<=CustomUndeadChance))
|
||||
switch (d6())
|
||||
{
|
||||
case 1 : ActionSpeakString(COLOR_RED+"Dead by dawn! Dead by dawn!",TALKVOLUME_TALK); break;
|
||||
case 2 : ActionSpeakString(COLOR_RED+"Death is only the beginning!",TALKVOLUME_TALK); break;
|
||||
case 3 : ActionSpeakString(COLOR_RED+"Darkness take me...",TALKVOLUME_TALK); break;
|
||||
case 4 : ActionSpeakString(COLOR_RED+"Free at last...",TALKVOLUME_TALK); break;
|
||||
case 5 : ActionSpeakString(COLOR_RED+"Time to die...",TALKVOLUME_TALK); break;
|
||||
case 6 : ActionSpeakString(COLOR_RED+"Thank you...",TALKVOLUME_TALK); break;
|
||||
} // "No more tears..."
|
||||
else switch (d6())
|
||||
{
|
||||
case 1: PlayVoiceChat(VOICE_CHAT_CUSS); break;
|
||||
case 2: PlayVoiceChat(VOICE_CHAT_DEATH); break;
|
||||
case 3: PlayVoiceChat(VOICE_CHAT_NEARDEATH); break;
|
||||
case 4: PlayVoiceChat(VOICE_CHAT_GOODBYE); break;
|
||||
case 5: PlayVoiceChat(VOICE_CHAT_LAUGH); break;
|
||||
case 6: PlayVoiceChat(VOICE_CHAT_HEALME); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//void main (){}
|
202
_module/nss/_inc_livingdead_.nss
Normal file
202
_module/nss/_inc_livingdead_.nss
Normal file
@@ -0,0 +1,202 @@
|
||||
#include "prc_inc_racial"
|
||||
|
||||
const float fUnlifespan = 300.0;
|
||||
|
||||
string SpawnOf(object oSpawnKiller = OBJECT_INVALID)
|
||||
{
|
||||
string sSpawn = "";
|
||||
string sKiller = GetName(oSpawnKiller, FALSE);
|
||||
object oLeft = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oSpawnKiller);
|
||||
object oRight = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oSpawnKiller);
|
||||
string sLeftTag = GetTag(oLeft);
|
||||
string sRightTag = GetTag(oRight);
|
||||
if (!(GetStringRight(sKiller, 6) ==" Spawn") ||
|
||||
!(GetStringRight(sKiller, 6) ==" Rat"))
|
||||
if ((GetIsPC(GetMaster(oSpawnKiller))||(GetIsPC(oSpawnKiller))))
|
||||
{
|
||||
if ((FindSubString(sKiller, "Morg")>-1)||
|
||||
(sRightTag=="vampirespawner")||
|
||||
(sLeftTag=="vampirespawner")) sSpawn = "namechspawn";
|
||||
/* // No Vampires on Athas
|
||||
if ((FindSubString(sKiller, "Vampire")>-1)||(sRightTag=="vampirespawner")||(sLeftTag=="vampirespawner"))
|
||||
{
|
||||
if (GetGender(OBJECT_SELF)==GENDER_FEMALE) sSpawn = "vampirespawn_f";
|
||||
else sSpawn = "vampirespawn_m";
|
||||
} */
|
||||
else if ((FindSubString(sKiller, "Tyrantfog")>-1)||(sRightTag=="tyrantfogspawner")) sSpawn = "zombiespawn";
|
||||
else if (FindSubString(sKiller, "Ghoul")>-1) sSpawn = "ghoulspawn";
|
||||
else if (FindSubString(sKiller, "Ghast")>-1) sSpawn = "ghoulspawn";
|
||||
else if ((FindSubString(sKiller, "Shadow")>-1)||(sRightTag=="shadowspawner")) sSpawn = "shadowspawn";
|
||||
else if (FindSubString(sKiller, "Spectre")>-1) sSpawn = "spectrespawn";
|
||||
else if (FindSubString(sKiller, "Wraith")>-1) sSpawn = "wraithspawn";
|
||||
else if ((FindSubString(sKiller, "Wight")>-1)||(sRightTag=="wightspawner")) sSpawn = "wightspawn";
|
||||
else if (FindSubString(sKiller, "Crypt Chanter")>-1) sSpawn = "wraithspawn";
|
||||
else if (FindSubString(sKiller, "Bleakborn")>-1) sSpawn = "zombiespawn";
|
||||
else if (FindSubString(sKiller, "Bodak")>-1) sSpawn = "zombiespawn";
|
||||
else if (FindSubString(sKiller, "T'liz")>-1) sSpawn = "namechspawn";
|
||||
else if ((FindSubString(sKiller, "Meorty")>-1) ||
|
||||
(FindSubString(sKiller, "Amithrang")>-1)) sSpawn = "namechspawn";
|
||||
}
|
||||
else // Monster Killer
|
||||
{
|
||||
if (FindSubString(sKiller, "Tyrantfog")>-1) sSpawn = "zombiespawn";
|
||||
else if (FindSubString(sKiller, "Ghast")>-1) sSpawn = "ghoulspawn";
|
||||
else if (FindSubString(sKiller, "Ghoul")>-1) sSpawn = "ghoulspawn";
|
||||
else if (((FindSubString(sKiller, "Meorty")>-1) ||
|
||||
(FindSubString(sKiller, "Amithrang")>-1))) sSpawn = "namechspawn";
|
||||
else if (FindSubString(sKiller, "Shadow")>-1) sSpawn = "shadowspawn";
|
||||
else if (FindSubString(sKiller, "Spectre")>-1) sSpawn = "spectrespawn";
|
||||
else if (FindSubString(sKiller, "Crypt Chanter")>-1) sSpawn = "wraithspawn";
|
||||
else if (FindSubString(sKiller, "Bleakborn")>-1) sSpawn = "zombiespawn";
|
||||
else if (FindSubString(sKiller, "Bodak")>-1) sSpawn = "zombiespawn";
|
||||
else if (FindSubString(sKiller, "T'liz")>-1) sSpawn = "namechspawn";
|
||||
else if ((FindSubString(sKiller, "Morg")>-1)||
|
||||
(sRightTag=="vampirespawner")||
|
||||
(sLeftTag=="vampirespawner")) sSpawn = "namechspawn";
|
||||
/* //No Vampires on Athas
|
||||
{
|
||||
if (GetGender(OBJECT_SELF)==GENDER_FEMALE) sSpawn = "vampirespawn_f";
|
||||
else sSpawn = "vampirespawn_m";
|
||||
}*/
|
||||
else if (FindSubString(sKiller, "Wight")>-1) sSpawn = "wightspawn";
|
||||
if (FindSubString(sKiller, "Wraith")>-1) sSpawn = "wraithspawn";
|
||||
}
|
||||
return sSpawn;
|
||||
}
|
||||
|
||||
int ShadeType(object oShadeKiller = OBJECT_INVALID)
|
||||
{
|
||||
int iShade = 0;
|
||||
string sSpawn = "";
|
||||
string sKiller = GetName(oShadeKiller);
|
||||
object oRight = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oShadeKiller);
|
||||
string sRightTag = GetTag(oRight);
|
||||
if ((FindSubString(sKiller, "Shadow")>-1)||(sRightTag=="shadowspawner")) iShade = 1;
|
||||
else if (FindSubString(sKiller, "Spectre")>-1) iShade = 2;
|
||||
if (FindSubString(sKiller, "Wraith")>-1) iShade = 3;
|
||||
return iShade;
|
||||
}
|
||||
|
||||
int IsSpawnable(int iSpawnRace)
|
||||
{
|
||||
int iSpawnable = 0;
|
||||
if ((iSpawnRace == RACIAL_TYPE_ANIMAL)||
|
||||
(iSpawnRace == RACIAL_TYPE_BEAST)||
|
||||
(iSpawnRace == RACIAL_TYPE_MAGICAL_BEAST)||
|
||||
(iSpawnRace == RACIAL_TYPE_SHAPECHANGER)||
|
||||
(iSpawnRace == RACIAL_TYPE_VERMIN)||
|
||||
(iSpawnRace == RACIAL_TYPE_ABERRATION)||
|
||||
(iSpawnRace == RACIAL_TYPE_FEY)||
|
||||
(iSpawnRace == RACIAL_TYPE_GIANT)||
|
||||
(iSpawnRace == RACIAL_TYPE_HUMANOID_GOBLINOID)||
|
||||
(iSpawnRace == RACIAL_TYPE_HUMANOID_MONSTROUS)||
|
||||
(iSpawnRace == RACIAL_TYPE_HUMANOID_ORC)||
|
||||
(iSpawnRace == RACIAL_TYPE_HUMANOID_REPTILIAN)||
|
||||
(iSpawnRace == RACIAL_TYPE_DRAGON)||
|
||||
(iSpawnRace == RACIAL_TYPE_DWARF)||
|
||||
(iSpawnRace == RACIAL_TYPE_ELF)||
|
||||
(iSpawnRace == RACIAL_TYPE_GNOME)||
|
||||
(iSpawnRace == RACIAL_TYPE_HALFELF)||
|
||||
(iSpawnRace == RACIAL_TYPE_HALFLING)||
|
||||
(iSpawnRace == RACIAL_TYPE_HUMAN)||
|
||||
(iSpawnRace == RACIAL_TYPE_HALFORC))
|
||||
iSpawnable = 1;
|
||||
return iSpawnable;
|
||||
}
|
||||
|
||||
int IsNonHuman(int iSpawnRace)
|
||||
{
|
||||
int iSpawnable = 0;
|
||||
if ((iSpawnRace == RACIAL_TYPE_ANIMAL)||
|
||||
(iSpawnRace == RACIAL_TYPE_BEAST)||
|
||||
(iSpawnRace == RACIAL_TYPE_DRAGON)||
|
||||
(iSpawnRace == RACIAL_TYPE_MAGICAL_BEAST)||
|
||||
(iSpawnRace == RACIAL_TYPE_VERMIN)||
|
||||
(iSpawnRace == RACIAL_TYPE_ABERRATION)||
|
||||
(iSpawnRace == RACIAL_TYPE_FEY)||
|
||||
(iSpawnRace == RACIAL_TYPE_GIANT) ||
|
||||
(iSpawnRace == RACIAL_TYPE_HUMANOID_GOBLINOID)||
|
||||
(iSpawnRace == RACIAL_TYPE_HUMANOID_MONSTROUS)||
|
||||
(iSpawnRace == RACIAL_TYPE_HUMANOID_ORC)||
|
||||
(iSpawnRace == RACIAL_TYPE_HUMANOID_REPTILIAN))
|
||||
iSpawnable = 1;
|
||||
return iSpawnable;
|
||||
}
|
||||
|
||||
int UndeadCheck(object oMyKiller)
|
||||
{
|
||||
int iPassed = 0;
|
||||
int iSpawnVFX = VFX_FNF_SUMMON_UNDEAD;
|
||||
object oMyKiller = GetLastKiller();
|
||||
int iRace = MyPRCGetRacialType(OBJECT_SELF);
|
||||
int iKillerRace = MyPRCGetRacialType(oMyKiller);
|
||||
int iKillerUndeadClass = GetLevelByClass(CLASS_TYPE_UNDEAD, oMyKiller);
|
||||
object oLeft = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oMyKiller);
|
||||
object oRight = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oMyKiller);
|
||||
string sLeftTag = GetTag(oLeft);
|
||||
string sRightTag = GetTag(oRight);
|
||||
if ((iKillerRace==RACIAL_TYPE_UNDEAD)
|
||||
||(iKillerUndeadClass>0)
|
||||
||(sRightTag=="tyrantfogspawner")
|
||||
||(sRightTag=="shadowspawner")
|
||||
||(sRightTag=="CR_SLAM_PSISHAD1")
|
||||
||(sLeftTag=="CR_SLAM_PSISHAD1")
|
||||
||(sRightTag=="vampirespawner")
|
||||
||(sLeftTag=="vampirespawner"))
|
||||
if (IsSpawnable(iRace))
|
||||
{
|
||||
string sSpawnStr = SpawnOf(oMyKiller);
|
||||
if (sSpawnStr != "")
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(iSpawnVFX), OBJECT_SELF);
|
||||
object oSpawn = CreateObject(OBJECT_TYPE_CREATURE, sSpawnStr, GetLocation(OBJECT_SELF));
|
||||
if (GetIsObjectValid(oSpawn)) iPassed = 1;
|
||||
SetPortraitId(oSpawn, GetPortraitId(OBJECT_SELF));
|
||||
if (GetIsPC(GetMaster(oMyKiller))||(GetIsPC(oMyKiller)))
|
||||
{
|
||||
SetName(oSpawn,GetName(OBJECT_SELF,FALSE)+" "+GetName(oSpawn,TRUE));
|
||||
if (GetIsObjectValid(GetMaster(oMyKiller)))
|
||||
AddHenchman(GetMaster(oMyKiller), oSpawn);
|
||||
else AddHenchman(oMyKiller, oSpawn);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetName(oSpawn,GetName(OBJECT_SELF,FALSE)+" "+GetName(oSpawn,TRUE));
|
||||
//if (FindSubString(GetName(OBJECT_SELF)," Spawn")==-1) SetName(GetName(OBJECT_SELF)+ " Spawn");
|
||||
ChangeFaction(oSpawn,oMyKiller);
|
||||
}
|
||||
int iShadeNum = 0;
|
||||
if (IsNonHuman(iRace))
|
||||
{
|
||||
SetCreatureAppearanceType(oSpawn,GetAppearanceType(OBJECT_SELF));
|
||||
iShadeNum = ShadeType(oMyKiller);
|
||||
switch (iShadeNum)
|
||||
{
|
||||
case 1: //dark shadows
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,SupernaturalEffect(EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR)),oSpawn,7.0);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,SupernaturalEffect(EffectVisualEffect(VFX_DUR_GHOST_TRANSPARENT)),oSpawn,7.0);
|
||||
break;
|
||||
case 2: //grey spectre
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,SupernaturalEffect(EffectVisualEffect(VFX_DUR_GHOST_TRANSPARENT)),oSpawn,7.0);
|
||||
break;
|
||||
case 3: //light wraith
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,SupernaturalEffect(EffectVisualEffect(VFX_DUR_GLOW_GREY)),oSpawn,7.0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (iShadeNum>0) //Fly off
|
||||
{
|
||||
DelayCommand(fUnlifespan-1.5,ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectDisappear(), oSpawn));
|
||||
DestroyObject(oSpawn, fUnlifespan);
|
||||
}
|
||||
else // Decay and Disintegrate
|
||||
{
|
||||
DelayCommand(fUnlifespan-1.5,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_IMP_DEATH), oSpawn));
|
||||
DestroyObject(oSpawn, fUnlifespan);
|
||||
}
|
||||
}
|
||||
}
|
||||
return iPassed;
|
||||
}
|
||||
|
||||
//void main() {}
|
34
_module/nss/ds_ai_attacked.nss
Normal file
34
_module/nss/ds_ai_attacked.nss
Normal file
@@ -0,0 +1,34 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name ds_ai_attacked
|
||||
//:: Copyright (c) 2022 Project RATDOG
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnAttacked event script caller to run CODI
|
||||
AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20221201
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
//--------------------------------------------------------------------------
|
||||
// GZ: 2003-10-16
|
||||
// Make Plot Creatures Ignore Attacks
|
||||
//--------------------------------------------------------------------------
|
||||
if (GetPlotFlag(OBJECT_SELF))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//:: Execute the CODI AI NPC OnAttacked script
|
||||
ExecuteScript("no_ai_atk", OBJECT_SELF);
|
||||
|
||||
//:: Execute the Default NPC OnAttacked script
|
||||
//ExecuteScript("nw_c2_default5", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnAttacked script
|
||||
ExecuteScript("prc_npc_physatt", OBJECT_SELF);
|
||||
|
||||
}
|
25
_module/nss/ds_ai_endcmbtrnd.nss
Normal file
25
_module/nss/ds_ai_endcmbtrnd.nss
Normal file
@@ -0,0 +1,25 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name ds_ai_endcmbtrnd
|
||||
//:: Copyright (c) 2022 Project RATDOG
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC EndCombatRound event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20221201
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
//:: Execute the CODI AI NPC OnCombatRoundEnd script
|
||||
ExecuteScript("no_ai_cmb", OBJECT_SELF);
|
||||
|
||||
//:: Execute the default NPC OnCombatRoundEnd script
|
||||
//ExecuteScript("nw_c2_default3", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnCombatRoundEnd script
|
||||
ExecuteScript("prc_npc_combat", OBJECT_SELF);
|
||||
}
|
65
_module/nss/ds_ai_heartbeat.nss
Normal file
65
_module/nss/ds_ai_heartbeat.nss
Normal file
@@ -0,0 +1,65 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name ds_ai_heartbeat
|
||||
//:: Copyright (c) 2022 Project RATDOG
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC Heartbeat event script caller to run CODI
|
||||
AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20221201
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
//:: Declare major variables
|
||||
object oNPC = OBJECT_SELF;
|
||||
object oAttacker;
|
||||
string sResRef = GetResRef(oNPC);
|
||||
|
||||
//:: Runs special swarm HB
|
||||
if (sResRef == "ds_repbatswrm001" ||
|
||||
sResRef == "ds_minkankswrm01" ||
|
||||
sResRef == "ds_locustswarm01" ||
|
||||
sResRef == "ar_berzwasp001" ||
|
||||
sResRef == "ar_berzwasp002" )
|
||||
{
|
||||
ExecuteScript("cr_locust_hb", oNPC);
|
||||
}
|
||||
|
||||
//:: Equips best armor
|
||||
if ((!GetIsInCombat(oNPC) && (GetItemInSlot(INVENTORY_SLOT_CHEST) == OBJECT_INVALID)))
|
||||
DelayCommand(0.5f, ActionEquipMostEffectiveArmor());
|
||||
|
||||
//:: Handles Vampire's Gaseous form death.
|
||||
if(sResRef == "ra_vamp_gas_form")
|
||||
{
|
||||
//:: Get nearest alive PC.
|
||||
oAttacker = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, oNPC, 1, CREATURE_TYPE_IS_ALIVE, TRUE);
|
||||
|
||||
//:: Set destroyable.
|
||||
SetIsDestroyable(TRUE, FALSE, FALSE);
|
||||
|
||||
//:: Remove plot/immoral/lootable flags JUST in case.
|
||||
SetPlotFlag(oNPC, FALSE);
|
||||
SetImmortal(oNPC, FALSE);
|
||||
SetLootable(oNPC, FALSE);
|
||||
|
||||
//:: Clear Actions & run away
|
||||
ClearAllActions();
|
||||
ActionMoveAwayFromObject(oAttacker, TRUE, 300.0f);
|
||||
|
||||
//:: Destroy ourselves after fleeing the scene
|
||||
DelayCommand(10.0f, DestroyObject(oNPC));
|
||||
}
|
||||
|
||||
//:: Execute the CODI NPC OnHeartbeat script
|
||||
ExecuteScript("no_ai_hrt", oNPC);
|
||||
|
||||
//:: Execute the default NPC OnHeartbeat script
|
||||
//ExecuteScript("nw_c2_default1", oNPC);
|
||||
|
||||
//:: Execute the PRC NPC OnHeartbeat script
|
||||
ExecuteScript("prc_npc_hb", oNPC);
|
||||
}
|
22
_module/nss/ds_ai_onblocked.nss
Normal file
22
_module/nss/ds_ai_onblocked.nss
Normal file
@@ -0,0 +1,22 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name ds_ai_onblocked
|
||||
//:: Copyright (c) 2022 Project RATDOG
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnBlocked event script caller to run CODI
|
||||
AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20221201
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
//:: Execute the CODI AI NPC OnBlocked script
|
||||
ExecuteScript("no_ai_blk", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnBlocked script
|
||||
ExecuteScript("prc_npc_blocked", OBJECT_SELF);
|
||||
}
|
26
_module/nss/ds_ai_onconverse.nss
Normal file
26
_module/nss/ds_ai_onconverse.nss
Normal file
@@ -0,0 +1,26 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name ds_ai_onconverse
|
||||
//:: Copyright (c) 2022 Project RATDOG
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnConversation event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20221201
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
//:: Execute the CODI AI NPC OnConversation script
|
||||
ExecuteScript("no_ai_cnv", OBJECT_SELF);
|
||||
|
||||
//:: Execute the default NPC OnConversation script
|
||||
//ExecuteScript("nw_c2_default4", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnConversation script
|
||||
ExecuteScript("prc_npc_conv", OBJECT_SELF);
|
||||
|
||||
}
|
53
_module/nss/ds_ai_ondamaged.nss
Normal file
53
_module/nss/ds_ai_ondamaged.nss
Normal file
@@ -0,0 +1,53 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name ds_ai_ondamaged
|
||||
//:: Copyright (c) 2022 Project RATDOG
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnDamaged event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20221201
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
int nTotalDamage = GetTotalDamageDealt();
|
||||
int nFireDamage = 0;
|
||||
|
||||
string sResRef = GetResRef(OBJECT_SELF);
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// GZ: 2003-10-16
|
||||
// Make Plot Creatures Ignore Attacks
|
||||
//--------------------------------------------------------------------------
|
||||
if (GetPlotFlag(OBJECT_SELF))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//:: Handles healing from fire damage
|
||||
if(sResRef == "BLEAKBORN001" || sResRef == "BLEAKBORN002")
|
||||
{
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_FIRE) != -1)
|
||||
{
|
||||
nFireDamage = GetDamageDealtByType(DAMAGE_TYPE_FIRE);
|
||||
//DelayCommand(0.0f, SpeakString("Fire Damage: " + IntToString(nFireDamage)));
|
||||
}
|
||||
|
||||
effect eHeal = EffectTemporaryHitpoints(nFireDamage/3);
|
||||
//DelayCommand(0.0f, SpeakString("Subdual damage healed: " + IntToString(nSubDmg)));
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, OBJECT_SELF, 0.0f);
|
||||
|
||||
}
|
||||
|
||||
//:: Execute the CODI AI NPC OnDamaged script
|
||||
ExecuteScript("no_ai_dam", OBJECT_SELF);
|
||||
|
||||
//:: Execute the Default NPC OnDamaged script
|
||||
//ExecuteScript("nw_c2_default6", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnDamaged script
|
||||
ExecuteScript("prc_npc_damaged", OBJECT_SELF);
|
||||
}
|
364
_module/nss/ds_ai_ondeath.nss
Normal file
364
_module/nss/ds_ai_ondeath.nss
Normal file
@@ -0,0 +1,364 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name ds_ai_ondeath
|
||||
//:: Copyright (c) 2022 Project RATDOG
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnDeath event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20221201
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
// Necromancy 101 /////////
|
||||
#include "_inc_livingdead_"
|
||||
#include "_inc_battlecry_"
|
||||
////////////////////////////
|
||||
#include "nw_i0_spells"
|
||||
#include "nw_i0_plot"
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_inc_racial"
|
||||
|
||||
void DropArmor(object oNPC)
|
||||
{
|
||||
object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oNPC);
|
||||
object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oNPC);
|
||||
|
||||
//:: Give a 3% chance to drop armor &/or equipped weapon
|
||||
int bDroppableA = d100() > 97;
|
||||
int bDroppableW = d100() > 97;
|
||||
|
||||
SetDroppableFlag(oArmor, bDroppableA);
|
||||
SetDroppableFlag(oWeapon, bDroppableW);
|
||||
}
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
//:: Declare major variables
|
||||
object oNPC = OBJECT_SELF;
|
||||
object oPC = GetLastKiller();
|
||||
|
||||
int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG");
|
||||
|
||||
string sTagSelf = GetTag(oNPC);
|
||||
string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET");
|
||||
|
||||
string sResRef = GetResRef(oNPC);
|
||||
|
||||
if (GetLocalInt(GetModule(),"X3_ENABLE_MOUNT_DB")&&GetIsObjectValid(GetMaster(OBJECT_SELF))) SetLocalInt(GetMaster(OBJECT_SELF),"bX3_STORE_MOUNT_INFO",TRUE);
|
||||
|
||||
// Makes sure armor's droppable flag is set to 0
|
||||
/* SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF), 0);
|
||||
|
||||
if ((GetResRef(oNPC) == "ra_bandit001") ||
|
||||
(GetResRef(oNPC) == "ra_brigand001") ||
|
||||
(GetResRef(oNPC) == "ra_brigand002"))
|
||||
{
|
||||
object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oNPC);
|
||||
object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oNPC);
|
||||
object oShield = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oNPC);
|
||||
|
||||
// Give a 3% chance to drop armor &/or equipped weapon
|
||||
int bDroppableA = d100() > 97;
|
||||
int bDroppableW = d100() > 97;
|
||||
int bDroppableS = d100() > 97;
|
||||
|
||||
SetDroppableFlag(oArmor, bDroppableA);
|
||||
SetDroppableFlag(oWeapon, bDroppableW);
|
||||
SetDroppableFlag(oWeapon, bDroppableS);
|
||||
|
||||
}*/
|
||||
|
||||
//:: Small chance to drop certain NPC armor
|
||||
if ((GetResRef(oNPC) == "NPC_KLEDGUARD") ||
|
||||
(GetResRef(oNPC) == "NPC_IANTO_GUARD1") ||
|
||||
(GetResRef(oNPC) == "NPC_IANTO_GUARD2") ||
|
||||
(GetResRef(oNPC) == "ds_vorlon_guard1") ||
|
||||
(GetResRef(oNPC) == "silt_pirate001") ||
|
||||
(GetResRef(oNPC) == "ds_vorlon_guard2"))
|
||||
{
|
||||
DropArmor(oNPC);
|
||||
}
|
||||
|
||||
|
||||
//:: Check for correct Kill Task quest target and complete
|
||||
if(sTagSelf == sTagTarget && nKillFlag == 1)
|
||||
{
|
||||
SetLocalInt(oPC, "KILL_TASK_FLAG", 2);
|
||||
AddJournalQuestEntry("kt_journal_01", 99, oPC);
|
||||
}
|
||||
|
||||
int nInsanity = GetLocalInt(OBJECT_SELF,"INSANITY");
|
||||
if(nInsanity)
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = GetLastKiller();
|
||||
effect eConfuse = EffectConfused();
|
||||
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_NORMAL_20);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_CONFUSION_S);
|
||||
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
effect eLink = EffectLinkEffects(eMind, eConfuse);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
eLink = SupernaturalEffect(eLink);
|
||||
|
||||
// Get oCaster's DC
|
||||
int nCreCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oCaster);
|
||||
int nCreHD = GetHitDice (oCaster);
|
||||
int nDC = (10 + (nCreHD/2) + nCreCHAMod);
|
||||
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, GetSpellTargetLocation());
|
||||
|
||||
if ( !PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oCaster))
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); // Apply Viz
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget);
|
||||
AssignCommand(oTarget,SpeakString("*The "+GetName(oCaster)+" has driven you insane!*"));
|
||||
}
|
||||
}
|
||||
|
||||
int nVFX = GetLocalInt(OBJECT_SELF,"SpawnVFX");
|
||||
if(nVFX)
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,SupernaturalEffect(EffectVisualEffect(nVFX)),OBJECT_SELF);
|
||||
}
|
||||
int nFirey = GetLocalInt(OBJECT_SELF,"FIREY");
|
||||
if (nFirey)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_INFERNO_NO_SOUND);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY");
|
||||
if (nShadowy)
|
||||
{
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nStony = GetLocalInt(OBJECT_SELF,"STONY");
|
||||
if (nStony)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_PROT_STONESKIN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nWoody = GetLocalInt(OBJECT_SELF,"WOODY");
|
||||
if (nWoody)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_PROT_BARKSKIN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nIcy = GetLocalInt(OBJECT_SELF,"ICY");
|
||||
if (nIcy)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_ICESKIN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
int nConcealed20 = GetLocalInt(OBJECT_SELF,"CONCEALED20");
|
||||
if (nConcealed20)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_BLUR );
|
||||
effect eConceal = EffectConcealment(20, 0);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nConcealed50 = GetLocalInt(OBJECT_SELF,"CONCEALED50");
|
||||
if (nConcealed50)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_BLUR );
|
||||
effect eConceal = EffectConcealment(50, 0);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nGlow = GetLocalInt (OBJECT_SELF,"GLOW_COLOR");
|
||||
if (nGlow == 1)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BLUE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 2)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 3)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 4)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 5)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_BLUE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 6)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_BROWN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 7)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_GREEN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 8)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_ORANGE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 9)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_PURPLE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 10)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_RED);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 11)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_YELLOW);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 12)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 13)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 14)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
else if (nGlow == 15)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 16)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
|
||||
//:: Vampire's Gaseous Form onDeath
|
||||
if(sResRef == "ra_vampspawn01" || sResRef == "ra_vampspawn02")
|
||||
{
|
||||
effect eVFX;
|
||||
object oSpawn;
|
||||
location lSelf = GetLocation(OBJECT_SELF);
|
||||
|
||||
//:: Apply some visual effects & unload the model.
|
||||
eVFX = EffectVisualEffect(VFX_COM_UNLOAD_MODEL);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oNPC);
|
||||
eVFX = EffectVisualEffect(VFX_COM_BLOOD_CRT_RED);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oNPC);
|
||||
eVFX = EffectVisualEffect(491);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oNPC);
|
||||
eVFX = EffectVisualEffect(VFX_COM_CHUNK_RED_SMALL);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oNPC);
|
||||
eVFX = EffectVisualEffect(VFX_FNF_SMOKE_PUFF);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oNPC);
|
||||
|
||||
//:: Spawn Gaseous Form.
|
||||
eVFX = EffectVisualEffect(133);
|
||||
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ra_vamp_gas_form", GetLocation(oNPC));
|
||||
DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oSpawn));;
|
||||
|
||||
}
|
||||
|
||||
//:: Small chance to drop certain NPC armor
|
||||
if ((GetResRef(oNPC) == "NPC_KLEDGUARD") ||
|
||||
(GetResRef(oNPC) == "NPC_IANTO_GUARD1") ||
|
||||
(GetResRef(oNPC) == "NPC_IANTO_GUARD2") ||
|
||||
(GetResRef(oNPC) == "ds_vorlon_guard1") ||
|
||||
(GetResRef(oNPC) == "silt_pirate001") ||
|
||||
(GetResRef(oNPC) == "silt_pirate002") ||
|
||||
(GetResRef(oNPC) == "DS_THRAX001") ||
|
||||
(GetResRef(oNPC) == "ds_vorlon_guard2"))
|
||||
{
|
||||
DropArmor(oNPC);
|
||||
}
|
||||
|
||||
// Necromancy 101 ///////////////////////
|
||||
DoDeathCry();
|
||||
if (UndeadCheck(GetLastKiller())) return;
|
||||
/////////////////////////////////////////
|
||||
|
||||
//:: Execute CODI AI NPC OnDeath script
|
||||
DelayCommand(0.0f, ExecuteScript("no_ai_dth", OBJECT_SELF));
|
||||
|
||||
//:: Execute Jasperre's NPC OnDeath script
|
||||
//ExecuteScript("nw_c2_default7", OBJECT_SELF);
|
||||
|
||||
//:: Execute PRC NPC OnDeath script
|
||||
DelayCommand(0.0f, ExecuteScript("prc_npc_death", OBJECT_SELF));
|
||||
|
||||
//:: Execute PRC PW OnDeath scripts
|
||||
DelayCommand(0.0f, ExecuteScript("prc_pwondeath", OBJECT_SELF));
|
||||
|
||||
}
|
26
_module/nss/ds_ai_ondisturb.nss
Normal file
26
_module/nss/ds_ai_ondisturb.nss
Normal file
@@ -0,0 +1,26 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name ds_ai_ondisturb
|
||||
//:: Copyright (c) 2022 Project RATDOG
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnDisturbed event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20221201
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
//:: Execute the CODI AI NPC OnDisturbed script
|
||||
ExecuteScript("no_ai_dis", OBJECT_SELF);
|
||||
|
||||
//:: Execute the default NPC OnDisturbed script
|
||||
//ExecuteScript("nw_c2_default8", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnDisturbed script
|
||||
ExecuteScript("prc_npc_blocked", OBJECT_SELF);
|
||||
|
||||
}
|
51
_module/nss/ds_ai_onpercept.nss
Normal file
51
_module/nss/ds_ai_onpercept.nss
Normal file
@@ -0,0 +1,51 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name ds_ai_onpercept
|
||||
//:: Copyright (c) 2022 Project RATDOG
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnPerception event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20221201
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
// Necromancy 101 /////////
|
||||
#include "_inc_battlecry_"
|
||||
////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
//:: Declare major variables
|
||||
object oPC = GetLastPerceived();
|
||||
object oHelm = GetItemInSlot(INVENTORY_SLOT_HEAD, oPC);
|
||||
object oMyHelm = GetItemInSlot(INVENTORY_SLOT_HEAD, OBJECT_SELF);
|
||||
|
||||
int nRiverVA = GetStringLeft(GetTag(OBJECT_SELF), 6) == "RB_VA_" ? TRUE : FALSE;
|
||||
int nRiverUrik = GetStringLeft(GetTag(OBJECT_SELF), 8) == "RB_URIK_" ? TRUE : FALSE;
|
||||
|
||||
|
||||
//:: Helm based faction handling for the River of Blood quest.
|
||||
if(nRiverVA == TRUE || nRiverUrik == TRUE)
|
||||
{
|
||||
if (GetTag(oHelm) == GetTag(oMyHelm))
|
||||
AdjustReputation(oPC, OBJECT_SELF, 100);
|
||||
if (GetTag(oHelm) != GetTag(oMyHelm))
|
||||
AdjustReputation(oPC, OBJECT_SELF, -100);
|
||||
}
|
||||
|
||||
|
||||
//:: Execute the CODI AI NPC OnPerception script
|
||||
ExecuteScript("no_ai_per", OBJECT_SELF);
|
||||
|
||||
//:: Execute the default NPC OnPerception script
|
||||
//ExecuteScript("nw_c2_default2", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnPerception script
|
||||
ExecuteScript("prc_npc_percep", OBJECT_SELF);
|
||||
|
||||
// Necromancy 101 ///
|
||||
DoBattleCry();
|
||||
/////////////////////
|
||||
}
|
25
_module/nss/ds_ai_onrested.nss
Normal file
25
_module/nss/ds_ai_onrested.nss
Normal file
@@ -0,0 +1,25 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name ds_ai_onrested
|
||||
//:: Copyright (c) 2022 Project RATDOG
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnRested event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20221201
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
//:: Execute the CODI AI NPC OnRested script
|
||||
ExecuteScript("no_ai_rst", OBJECT_SELF);
|
||||
|
||||
//:: Execute the default NPC OnRested script
|
||||
//ExecuteScript("nw_c2_defaulta", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnRested script
|
||||
ExecuteScript("prc_npc_rested", OBJECT_SELF);
|
||||
}
|
816
_module/nss/ds_ai_onspawn.nss
Normal file
816
_module/nss/ds_ai_onspawn.nss
Normal file
@@ -0,0 +1,816 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name ds_ai_onspawn
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:: Copyright (c) 2022 Project RATDOG
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnSpawn event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
2003-07-28: Georg Zoeller:
|
||||
|
||||
If you set a ninteger on the creature named
|
||||
"X2_USERDEFINED_ONSPAWN_EVENTS"
|
||||
The creature will fire a pre and a post-spawn
|
||||
event on itself, depending on the value of that
|
||||
variable
|
||||
1 - Fire Userdefined Event 1510 (pre spawn)
|
||||
2 - Fire Userdefined Event 1511 (post spawn)
|
||||
3 - Fire both events
|
||||
|
||||
2007-12-31: Deva Winblood
|
||||
Modified to look for X3_HORSE_OWNER_TAG and if
|
||||
it is defined look for an NPC with that tag
|
||||
nearby or in the module (checks near first).
|
||||
It will make that NPC this horse's master.
|
||||
|
||||
20221201: Jaysyn
|
||||
Modified to read desired CODI AI spawner
|
||||
from string var "SPAWN_TYPE" set on the NPC,
|
||||
defaults to fighter.
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Keith Warner, Georg Zoeller
|
||||
//:: Created On: June 11/03
|
||||
//:: Modified By: Jaysyn
|
||||
//:: Modified On: 20221201
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
const int EVENT_USER_DEFINED_PRESPAWN = 1510;
|
||||
const int EVENT_USER_DEFINED_POSTSPAWN = 1511;
|
||||
|
||||
#include "NW_I0_GENERIC"
|
||||
#include "ms_name_inc"
|
||||
#include "x2_inc_switches"
|
||||
#include "rnd_commoner_inc"
|
||||
#include "ds_rnd_armor_inc"
|
||||
#include "ds_rnd_level"
|
||||
|
||||
|
||||
void ShrinkEm(object oNPC)
|
||||
{
|
||||
SetObjectVisualTransform(OBJECT_SELF, OBJECT_VISUAL_TRANSFORM_SCALE, 0.3f);
|
||||
}
|
||||
|
||||
void Embiggen(object oNPC)
|
||||
{
|
||||
SetObjectVisualTransform(OBJECT_SELF, OBJECT_VISUAL_TRANSFORM_SCALE, 1.15f);
|
||||
}
|
||||
|
||||
void GrowEm(object oNPC)
|
||||
{
|
||||
SetObjectVisualTransform(OBJECT_SELF, OBJECT_VISUAL_TRANSFORM_SCALE, 1.5f);
|
||||
}
|
||||
|
||||
void NoFreeGear(object oNPC)
|
||||
{
|
||||
object oArmor;
|
||||
object oWeapon;
|
||||
|
||||
oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF);
|
||||
oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, OBJECT_SELF);
|
||||
|
||||
SetDroppableFlag(oArmor, FALSE);
|
||||
SetDroppableFlag(oWeapon, FALSE);
|
||||
}
|
||||
|
||||
void AutoLevel(object oNPC)
|
||||
{
|
||||
// Initialize Variables
|
||||
|
||||
int nBoost = 0;
|
||||
int nTotalPCs = 0;
|
||||
int nTotalPCLevel = 0;
|
||||
int nAveragePCLevel = 0;
|
||||
int nDifficulty = d2(1);
|
||||
int nRnd = d3(1);
|
||||
int nCreHD = GetHitDice(OBJECT_SELF);
|
||||
|
||||
object oArea = GetArea(OBJECT_SELF);
|
||||
|
||||
string sAreaName = GetName(oArea);
|
||||
|
||||
// Cycle through PCs in Area
|
||||
object oPC = GetFirstObjectInArea(oArea);
|
||||
|
||||
//SendMessageToPC(oPC, "OnSpawn: AutoLevel is running in "+sAreaName+".");
|
||||
//SendMessageToAllDMs("OnSpawn: AutoLevel is running in "+sAreaName+".");
|
||||
//SendMessageToPC(oPC, "OnSpawn: AutoLevel Difficulty = "+IntToString(nDifficulty));
|
||||
//SendMessageToAllDMs("OnSpawn: AutoLevel Difficulty = "+IntToString(nDifficulty));
|
||||
//SendMessageToPC(oPC, "OnSpawn: AutoLevel Randomness = "+IntToString(nRnd));
|
||||
//SendMessageToAllDMs("OnSpawn: AutoLevel Randomness = "+IntToString(nRnd));
|
||||
//SendMessageToPC(oPC, "OnSpawn: Creature starting HD = "+IntToString(nCreHD));
|
||||
//SendMessageToAllDMs("OnSpawn: Creature starting HD = "+IntToString(nCreHD));
|
||||
|
||||
while (oPC != OBJECT_INVALID)
|
||||
{
|
||||
|
||||
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) // Summons & henchmen should count towards this.
|
||||
{
|
||||
nTotalPCs++;
|
||||
nTotalPCLevel += GetHitDice(oPC);
|
||||
//SendMessageToPC(oPC, "TotalPCs = "+ IntToString(nTotalPCs)+ " TotalHD = "+IntToString(nTotalPCLevel));
|
||||
//SendMessageToAllDMs("TotalPCs = "+ IntToString(nTotalPCs)+ " TotalHD = "+IntToString(nTotalPCLevel));
|
||||
}
|
||||
|
||||
oPC = GetNextObjectInArea(oArea);
|
||||
}
|
||||
|
||||
//SendMessageToPC(oPC, "Total PCs in Area = "+IntToString(nTotalPCs));
|
||||
//SendMessageToAllDMs("Total PCs in Area = "+IntToString(nTotalPCs));
|
||||
|
||||
if (nTotalPCs > 0)
|
||||
{
|
||||
nAveragePCLevel = nTotalPCLevel / nTotalPCs;
|
||||
}
|
||||
else
|
||||
{
|
||||
nAveragePCLevel = 3;
|
||||
}
|
||||
|
||||
//SendMessageToPC(oPC, "Average PC Level = "+IntToString(nAveragePCLevel));
|
||||
//SendMessageToAllDMs("Average PC Level = "+IntToString(nAveragePCLevel));
|
||||
|
||||
// Advance creature
|
||||
if (nRnd == 1)
|
||||
{
|
||||
nBoost = nAveragePCLevel + nDifficulty;
|
||||
//SendMessageToPC(oPC, "2nd Stage: Adding "+IntToString(nDifficulty)+" difficulty. nBoost = "+IntToString(nBoost));
|
||||
//SendMessageToAllDMs("2nd Stage: Adding "+IntToString(nDifficulty)+" difficulty. nBoost = "+IntToString(nBoost));
|
||||
//SendMessageToPC(oPC, "2nd Stage: LevelMob Running - Harder Difficulty");
|
||||
//SendMessageToAllDMs("2nd Stage: LevelMob Running - Harder Difficulty");
|
||||
//SendMessageToPC(oPC, "2nd Stage: LevelMob adding "+IntToString(nBoost)+" Hit Dice");
|
||||
//SendMessageToAllDMs("2nd Stage: LevelMob adding "+IntToString(nBoost)+" Hit Dice");
|
||||
DelayCommand(0.0f, LevelMob(OBJECT_SELF, nBoost));
|
||||
SetLocalInt(OBJECT_SELF, PRC_CASTERLEVEL_OVERRIDE, nBoost);
|
||||
}
|
||||
else
|
||||
{
|
||||
nBoost = nAveragePCLevel - nDifficulty;
|
||||
//SendMessageToPC(oPC, "2nd Stage: Adding "+IntToString(nDifficulty)+" difficulty. nBoost = "+IntToString(nBoost));
|
||||
//SendMessageToAllDMs("2nd Stage: Adding "+IntToString(nDifficulty)+" difficulty. nBoost = "+IntToString(nBoost));
|
||||
//SendMessageToPC(oPC, "2nd Stage: LevelMob Running - Easier Difficulty");
|
||||
//SendMessageToAllDMs("2nd Stage: LevelMob Running - Easier Difficulty");
|
||||
//SendMessageToPC(oPC, "2nd Stage: LevelMob adding "+IntToString(nAveragePCLevel)+" Hit Dice");
|
||||
//SendMessageToAllDMs("2nd Stage: LevelMob adding "+IntToString(nAveragePCLevel)+" Hit Dice");
|
||||
DelayCommand(0.0f, LevelMob(OBJECT_SELF, nBoost));
|
||||
SetLocalInt(OBJECT_SELF, PRC_CASTERLEVEL_OVERRIDE, nBoost);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
string sTag;
|
||||
string sResRef = GetResRef(OBJECT_SELF);
|
||||
string sSpawnType = "no_spn_ftr";
|
||||
|
||||
sSpawnType = GetLocalString(OBJECT_SELF,"SPAWN_TYPE");
|
||||
|
||||
if (sSpawnType == "")
|
||||
{
|
||||
sSpawnType = "no_spn_ftr";
|
||||
}
|
||||
|
||||
//: User defined OnSpawn event requested?
|
||||
int nSpecEvent = GetLocalInt(OBJECT_SELF,"X2_USERDEFINED_ONSPAWN_EVENTS");
|
||||
|
||||
|
||||
//:: Pre Spawn Event requested
|
||||
if (nSpecEvent == 1 || nSpecEvent == 3 )
|
||||
{
|
||||
SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_PRESPAWN ));
|
||||
}
|
||||
|
||||
//:: Creature will randomly level to within +/-2 levels of area's average PC lvl
|
||||
int nAutoLevel = GetLocalInt(OBJECT_SELF,"AUTOLEVEL");
|
||||
if (nAutoLevel > 0 )
|
||||
{
|
||||
DelayCommand(0.0f, AutoLevel(OBJECT_SELF));
|
||||
}
|
||||
|
||||
//:: Randomize Silt Pirate armor
|
||||
if ((sResRef == "silt_pirate001") ||
|
||||
(sResRef == "silt_pirate002"))
|
||||
{
|
||||
DelayCommand(0.0f, RndPirateArmor(OBJECT_SELF));
|
||||
ActionEquipMostEffectiveArmor();
|
||||
}
|
||||
|
||||
//:: Randomize Bandit armor
|
||||
if ((sResRef == "banditguard_001") ||
|
||||
(sResRef == "banditguard_002") ||
|
||||
(sResRef == "banditguard_003") ||
|
||||
(sResRef == "dunebandit_001") ||
|
||||
(sResRef == "dunebandit_002") ||
|
||||
(sResRef == "dunebandit_003") ||
|
||||
(sResRef == "halfbandit_001") ||
|
||||
(sResRef == "humanbandit_001") ||
|
||||
(sResRef == "humanbandit_002") ||
|
||||
(sResRef == "humanbandit_003") ||
|
||||
(sResRef == "humanbandit_004") ||
|
||||
(sResRef == "humanbandit_005") ||
|
||||
(sResRef == "elvenraider001") ||
|
||||
(sResRef == "warrensthug001") ||
|
||||
(sResRef == "ar_gulgslaver002") ||
|
||||
(sResRef == "ar_gulgslaver003") ||
|
||||
(sResRef == "ar_gulgslaver004"))
|
||||
{
|
||||
DelayCommand(0.0f, RndBanditArmor(OBJECT_SELF));
|
||||
ActionEquipMostEffectiveArmor();
|
||||
}
|
||||
|
||||
sTag=GetLocalString(OBJECT_SELF,"X3_HORSE_OWNER_TAG");
|
||||
if (GetStringLength(sTag)>0)
|
||||
{ // look for master
|
||||
object oNPC = GetNearestObjectByTag(sTag);
|
||||
if (GetIsObjectValid(oNPC)&&GetObjectType(oNPC)==OBJECT_TYPE_CREATURE)
|
||||
{ // master found
|
||||
AddHenchman(oNPC);
|
||||
} // master found
|
||||
else
|
||||
{ // look in module
|
||||
oNPC=GetObjectByTag(sTag);
|
||||
if (GetIsObjectValid(oNPC)&&GetObjectType(oNPC)==OBJECT_TYPE_CREATURE)
|
||||
{ // master found
|
||||
AddHenchman(oNPC);
|
||||
} // master found
|
||||
else
|
||||
{ // master does not exist - remove X3_HORSE_OWNER_TAG
|
||||
DeleteLocalString(oNPC,"X3_HORSE_OWNER_TAG");
|
||||
} // master does not exist - remove X3_HORSE_OWNER_TAG
|
||||
} // look in module
|
||||
} // look for master
|
||||
|
||||
|
||||
//:: Sets a random integer on the creature to use with other spell functions
|
||||
string sImmune = GetName(OBJECT_SELF)+"_AURA_IMMUNE";
|
||||
int nRandomSeed = Random(999);
|
||||
SetLocalInt(OBJECT_SELF, sImmune, nRandomSeed);
|
||||
|
||||
//:: Creature will quickly & automatically buff itself up with any defensive
|
||||
//:: spells it has memorized.
|
||||
|
||||
int nAutobuff = GetLocalInt(OBJECT_SELF,"AUTOBUFF");
|
||||
if (nAutobuff > 0 )
|
||||
{
|
||||
SetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY);
|
||||
}
|
||||
|
||||
//:: Creature will flee those that close within 7m if they are not friends,
|
||||
//:: Rangers or Druids.
|
||||
|
||||
int nHerbivore = GetLocalInt(OBJECT_SELF,"CREATURE_VAR_HERBIVORE");
|
||||
if (nHerbivore > 0 )
|
||||
{
|
||||
SetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL);
|
||||
SetBehaviorState(NW_FLAG_BEHAVIOR_HERBIVORE);
|
||||
}
|
||||
|
||||
//:: Creature will only attack those that close within 5m and are not friends,
|
||||
//:: Rangers or Druids.
|
||||
|
||||
int nOmnivore = GetLocalInt(OBJECT_SELF,"CREATURE_VAR_OMNIVORE");
|
||||
if (nOmnivore > 0 )
|
||||
{
|
||||
SetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL);
|
||||
SetBehaviorState(NW_FLAG_BEHAVIOR_OMNIVORE);
|
||||
}
|
||||
|
||||
int nOLM = GetLocalInt(OBJECT_SELF,"OLM");
|
||||
if (nOLM > 0)
|
||||
{
|
||||
DelayCommand(0.0f, ShrinkEm(OBJECT_SELF));
|
||||
|
||||
effect eSlow = EffectMovementSpeedDecrease(90);
|
||||
eSlow = SupernaturalEffect(eSlow);
|
||||
eSlow = ExtraordinaryEffect(eSlow);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eSlow,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nHuge = GetLocalInt(OBJECT_SELF,"HUGE");
|
||||
if (nHuge > 0)
|
||||
{
|
||||
DelayCommand(0.0f, GrowEm(OBJECT_SELF));
|
||||
|
||||
}
|
||||
|
||||
int nEmbiggen = GetLocalInt(OBJECT_SELF,"EMBIGGEN");
|
||||
if (nEmbiggen > 0)
|
||||
{
|
||||
DelayCommand(0.0f, Embiggen(OBJECT_SELF));
|
||||
|
||||
}
|
||||
|
||||
int nNoStun = GetLocalInt(OBJECT_SELF,"NOSTUN");
|
||||
if (nNoStun > 0)
|
||||
{
|
||||
effect eNoStun = EffectImmunity(IMMUNITY_TYPE_STUN);
|
||||
eNoStun = SupernaturalEffect(eNoStun);
|
||||
eNoStun = ExtraordinaryEffect(eNoStun);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eNoStun,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nNatInvis1 = GetLocalInt(OBJECT_SELF,"NATURAL_INVIS");
|
||||
if (nNatInvis1 == 1)
|
||||
{
|
||||
effect eNatInvis = EffectInvisibility(4);
|
||||
eNatInvis = SupernaturalEffect(eNatInvis);
|
||||
//eNatInvis = ExtraordinaryEffect(eNatInvis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eNatInvis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nNatInvis2 = GetLocalInt(OBJECT_SELF,"NATURAL_INVIS");
|
||||
if (nNatInvis2 == 2)
|
||||
{
|
||||
effect eNatInvis = EffectInvisibility(4);
|
||||
eNatInvis = SupernaturalEffect(eNatInvis);
|
||||
eNatInvis = ExtraordinaryEffect(eNatInvis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eNatInvis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nSeeInvis = GetLocalInt(OBJECT_SELF,"SEE_INVIS");
|
||||
if (nSeeInvis > 0)
|
||||
{
|
||||
effect eSeeInvis = EffectSeeInvisible();
|
||||
eSeeInvis = SupernaturalEffect(eSeeInvis);
|
||||
eSeeInvis = ExtraordinaryEffect(eSeeInvis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eSeeInvis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nNoSleep = GetLocalInt(OBJECT_SELF,"NOSLEEP");
|
||||
if (nNoSleep > 0)
|
||||
{
|
||||
effect eNoSleep = EffectImmunity(IMMUNITY_TYPE_SLEEP);
|
||||
eNoSleep = SupernaturalEffect(eNoSleep);
|
||||
eNoSleep = ExtraordinaryEffect(eNoSleep);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eNoSleep,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nNoDaze = GetLocalInt(OBJECT_SELF,"NODAZE");
|
||||
if (nNoDaze > 0)
|
||||
{
|
||||
effect eNoDaze = EffectImmunity(IMMUNITY_TYPE_DAZED);
|
||||
eNoDaze = SupernaturalEffect(eNoDaze);
|
||||
eNoDaze = ExtraordinaryEffect(eNoDaze);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eNoDaze,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nNoBlind = GetLocalInt(OBJECT_SELF,"NOBLIND");
|
||||
if (nNoBlind > 0)
|
||||
{
|
||||
effect eNoBlind = EffectImmunity(IMMUNITY_TYPE_BLINDNESS);
|
||||
eNoBlind = SupernaturalEffect(eNoBlind);
|
||||
eNoBlind = ExtraordinaryEffect(eNoBlind);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eNoBlind,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nNoDeaf = GetLocalInt(OBJECT_SELF,"NODEAF");
|
||||
if (nNoDeaf > 0)
|
||||
{
|
||||
effect eNoDeaf = EffectImmunity(IMMUNITY_TYPE_DEAFNESS);
|
||||
eNoDeaf = SupernaturalEffect(eNoDeaf);
|
||||
eNoDeaf = ExtraordinaryEffect(eNoDeaf);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eNoDeaf,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nDeaf = GetLocalInt(OBJECT_SELF,"IS_DEAF");
|
||||
if (nDeaf > 0)
|
||||
{
|
||||
effect eDeaf = EffectDeaf();
|
||||
eDeaf = SupernaturalEffect(eDeaf);
|
||||
eDeaf = ExtraordinaryEffect(eDeaf);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eDeaf,OBJECT_SELF));
|
||||
}
|
||||
|
||||
/* Fix for the new golems to reduce their number of attacks */
|
||||
|
||||
int nNumber = GetLocalInt(OBJECT_SELF,CREATURE_VAR_NUMBER_OF_ATTACKS);
|
||||
if (nNumber >0 )
|
||||
{
|
||||
SetBaseAttackBonus(nNumber);
|
||||
}
|
||||
|
||||
int nVFX = GetLocalInt(OBJECT_SELF,"SpawnVFX");
|
||||
if(nVFX)
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,SupernaturalEffect(EffectVisualEffect(nVFX)),OBJECT_SELF);
|
||||
}
|
||||
|
||||
int nRegen = GetLocalInt(OBJECT_SELF,"FAST_HEALING");
|
||||
if(nRegen)
|
||||
{
|
||||
effect eRegen = EffectRegenerate(nRegen, 6.0f);
|
||||
eRegen = SupernaturalEffect(eRegen);
|
||||
eRegen = ExtraordinaryEffect(eRegen);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eRegen, OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY");
|
||||
if (nShadowy)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nStony = GetLocalInt(OBJECT_SELF,"STONY");
|
||||
if (nStony)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_PROT_STONESKIN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
int nFirey = GetLocalInt(OBJECT_SELF,"FIREY");
|
||||
if (nFirey)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_INFERNO_NO_SOUND);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
int nWoody = GetLocalInt(OBJECT_SELF,"WOODY");
|
||||
if (nWoody)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_PROT_BARKSKIN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nConcealed20 = GetLocalInt(OBJECT_SELF,"CONCEALED20");
|
||||
if (nConcealed20)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_BLUR );
|
||||
effect eConceal = EffectConcealment(20, 0);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nConcealed50 = GetLocalInt(OBJECT_SELF,"CONCEALED50");
|
||||
if (nConcealed50)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_BLUR );
|
||||
effect eConceal = EffectConcealment(50, 0);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nIcy = GetLocalInt(OBJECT_SELF,"ICY");
|
||||
if (nIcy)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_ICESKIN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
int nSR = GetLocalInt(OBJECT_SELF,"SPELL_RESISTANCE");
|
||||
if ( nSR )
|
||||
{
|
||||
effect eSR = EffectSpellResistanceIncrease(nSR);
|
||||
eSR = SupernaturalEffect(eSR);
|
||||
eSR = ExtraordinaryEffect(eSR);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eSR,OBJECT_SELF);
|
||||
}
|
||||
|
||||
int nAttackBonus = GetLocalInt(OBJECT_SELF,"ATTACK_BONUS");
|
||||
if ( nAttackBonus )
|
||||
{
|
||||
effect eAttack = EffectAttackIncrease(nAttackBonus);
|
||||
eAttack = SupernaturalEffect(eAttack);
|
||||
eAttack = ExtraordinaryEffect(eAttack);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eAttack,OBJECT_SELF);
|
||||
}
|
||||
|
||||
int nIceShield = GetLocalInt(OBJECT_SELF,"FROST_SHIELD");
|
||||
if ( nIceShield )
|
||||
{
|
||||
effect eShield = EffectDamageShield(0,DAMAGE_BONUS_1d6,DAMAGE_TYPE_COLD);
|
||||
eShield = SupernaturalEffect(eShield);
|
||||
eShield = ExtraordinaryEffect(eShield);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eShield,OBJECT_SELF);
|
||||
}
|
||||
|
||||
int nAcidShield = GetLocalInt(OBJECT_SELF,"ACID_SHIELD");
|
||||
if ( nAcidShield )
|
||||
{
|
||||
effect eShield = EffectDamageShield(0,DAMAGE_BONUS_1d8,DAMAGE_TYPE_ACID);
|
||||
eShield = SupernaturalEffect(eShield);
|
||||
eShield = ExtraordinaryEffect(eShield);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eShield,OBJECT_SELF);
|
||||
}
|
||||
|
||||
int nSerratedEdge = GetLocalInt(OBJECT_SELF,"SERRATED_EDGE");
|
||||
if ( nSerratedEdge )
|
||||
{
|
||||
effect eShield = EffectDamageShield(0,DAMAGE_BONUS_1d6,DAMAGE_TYPE_SLASHING);
|
||||
eShield = SupernaturalEffect(eShield);
|
||||
eShield = ExtraordinaryEffect(eShield);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eShield,OBJECT_SELF);
|
||||
}
|
||||
|
||||
int nSpikedArmor = GetLocalInt(OBJECT_SELF,"SPIKED_ARMOR");
|
||||
if ( nSpikedArmor )
|
||||
{
|
||||
effect eShield = EffectDamageShield(0,DAMAGE_BONUS_1d4,DAMAGE_TYPE_PIERCING);
|
||||
eShield = SupernaturalEffect(eShield);
|
||||
eShield = ExtraordinaryEffect(eShield);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eShield,OBJECT_SELF);
|
||||
}
|
||||
|
||||
int nGlow = GetLocalInt (OBJECT_SELF,"GLOW_COLOR");
|
||||
if (nGlow == 1)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BLUE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 2)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 3)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 4)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 5)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_BLUE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 6)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_BROWN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 7)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_GREEN);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 8)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_ORANGE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 9)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_PURPLE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 10)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_RED);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 11)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_YELLOW);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 12)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 13)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 14)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 15)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
else if (nGlow == 16)
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW);
|
||||
eVis = SupernaturalEffect(eVis);
|
||||
eVis = ExtraordinaryEffect(eVis);
|
||||
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF));
|
||||
}
|
||||
|
||||
// Check for randomizations.
|
||||
|
||||
ms_Nomenclature(OBJECT_SELF);
|
||||
|
||||
int nKeepskin = GetLocalInt(OBJECT_SELF,"DS_KEEPSKIN");
|
||||
if (nKeepskin != 1)
|
||||
{
|
||||
rnd_skin(OBJECT_SELF);
|
||||
}
|
||||
|
||||
int nKeephead = GetLocalInt(OBJECT_SELF,"DS_KEEPHEAD");
|
||||
if (nKeephead != 1)
|
||||
{
|
||||
rnd_head(OBJECT_SELF);
|
||||
}
|
||||
|
||||
int nKeeptats = GetLocalInt(OBJECT_SELF,"DS_KEEPTATS");
|
||||
if (nKeeptats != 1)
|
||||
{
|
||||
rnd_tattoo(OBJECT_SELF);
|
||||
}
|
||||
|
||||
|
||||
//:: Handles various Aura effects
|
||||
int nAtropal = GetTag(OBJECT_SELF) == "ATROPAL001" ? TRUE : FALSE;
|
||||
if(nAtropal)ExecuteScript("atropal_aura",OBJECT_SELF);
|
||||
|
||||
int AtropalScion = GetTag(OBJECT_SELF) == "ATROPALSCION001" ? TRUE : FALSE;
|
||||
if(AtropalScion)ExecuteScript("neaura",OBJECT_SELF);
|
||||
|
||||
int nBleakborn = GetStringLeft(GetTag(OBJECT_SELF), 9) == "BLEAKBORN" ? TRUE : FALSE;
|
||||
if(nBleakborn)ExecuteScript("bleakaura",OBJECT_SELF);
|
||||
|
||||
int nCryptChanter = GetStringLeft(GetTag(OBJECT_SELF), 12) == "CRYPTCHANTER" ? TRUE : FALSE;
|
||||
if(nCryptChanter)ExecuteScript("DrainingMelody",OBJECT_SELF);
|
||||
|
||||
int nNWalker = GetStringLeft(GetTag(OBJECT_SELF), 11) == "NIGHTWALKER" ? TRUE : FALSE;
|
||||
if(nNWalker)ExecuteScript("desecrating_aura",OBJECT_SELF);
|
||||
|
||||
int nNCrawler = GetStringLeft(GetTag(OBJECT_SELF), 12) == "NIGHTCRAWLER" ? TRUE : FALSE;
|
||||
if(nNCrawler)ExecuteScript("desecrating_aura",OBJECT_SELF);
|
||||
|
||||
int nVoidWraith = GetStringLeft(GetTag(OBJECT_SELF), 10) == "VOIDWRAITH" ? TRUE : FALSE;
|
||||
if(nVoidWraith)ExecuteScript("airlessaura",OBJECT_SELF);
|
||||
|
||||
int nGhast = GetStringLeft(GetTag(OBJECT_SELF), 5) == "GHAST" ? TRUE : FALSE;
|
||||
if(nGhast)ExecuteScript("ghast_stench",OBJECT_SELF);
|
||||
|
||||
int nTliz = GetStringLeft(GetTag(OBJECT_SELF), 4) == "TLIZ" ? TRUE : FALSE;
|
||||
if(nTliz)ExecuteScript("tliz_aura",OBJECT_SELF);
|
||||
|
||||
int nDecay = GetStringLeft(GetTag(OBJECT_SELF), 12) == "ANGELOFDECAY" ? TRUE : FALSE;
|
||||
if(nDecay)ExecuteScript("rotura",OBJECT_SELF);
|
||||
|
||||
int nConsumeInt = GetStringLeft(GetTag(OBJECT_SELF), 13) == "DS_YELMUSKCRP" ? TRUE : FALSE;
|
||||
if(nConsumeInt)ExecuteScript("consume_int",OBJECT_SELF);
|
||||
|
||||
int nDecay1 = GetStringLeft(GetTag(OBJECT_SELF), 13) == "DS_YELMUSKCRP" ? TRUE : FALSE;
|
||||
if(nDecay1)ExecuteScript("consume_int",OBJECT_SELF);
|
||||
|
||||
int nMiniKanks = GetStringLeft(GetTag(OBJECT_SELF), 14) == "DS_MINKANKSWRM" ? TRUE : FALSE;
|
||||
if(nMiniKanks)ExecuteScript("swarm_minikank",OBJECT_SELF);
|
||||
|
||||
int nLocusts = GetStringLeft(GetTag(OBJECT_SELF), 14) == "DS_LOCUSTSWARM" ? TRUE : FALSE;
|
||||
if(nLocusts)ExecuteScript("swarm_locust",OBJECT_SELF);
|
||||
|
||||
int nBerzWasp1 = GetStringLeft(GetTag(OBJECT_SELF), 11) == "AR_BERZWASP" ? TRUE : FALSE;
|
||||
if(nBerzWasp1)ExecuteScript("swarm_berzwasp",OBJECT_SELF);
|
||||
|
||||
int nRepBats = GetStringLeft(GetTag(OBJECT_SELF), 13) == "DS_REPBATSWRM" ? TRUE : FALSE;
|
||||
if(nRepBats)ExecuteScript("swarm_repbat",OBJECT_SELF);
|
||||
|
||||
int nFordorran = GetStringLeft(GetTag(OBJECT_SELF), 12) == "DS_FORDORRAN" ? TRUE : FALSE;
|
||||
if(nFordorran)ExecuteScript("fordorran_aura",OBJECT_SELF);
|
||||
|
||||
int nPrisma = GetStringLeft(GetTag(OBJECT_SELF), 12) == "PRISMASAURUS" ? TRUE : FALSE;
|
||||
if(nPrisma)ExecuteScript("prism_aura",OBJECT_SELF);
|
||||
|
||||
|
||||
//:: Randomize Silt Pirate armor
|
||||
if ((GetResRef(OBJECT_SELF) == "silt_pirate001") ||
|
||||
(GetResRef(OBJECT_SELF) == "silt_pirate002"))
|
||||
{
|
||||
RndPirateArmor(OBJECT_SELF);
|
||||
ActionEquipMostEffectiveArmor();
|
||||
}
|
||||
|
||||
//:: Randomize Bandit armor
|
||||
if ((GetResRef(OBJECT_SELF) == "banditguard_001") ||
|
||||
(GetResRef(OBJECT_SELF) == "banditguard_002") ||
|
||||
(GetResRef(OBJECT_SELF) == "banditguard_003") ||
|
||||
(GetResRef(OBJECT_SELF) == "dunebandit_001") ||
|
||||
(GetResRef(OBJECT_SELF) == "dunebandit_002") ||
|
||||
(GetResRef(OBJECT_SELF) == "dunebandit_003") ||
|
||||
(GetResRef(OBJECT_SELF) == "halfbandit_001") ||
|
||||
(GetResRef(OBJECT_SELF) == "humanbandit_001") ||
|
||||
(GetResRef(OBJECT_SELF) == "humanbandit_002") ||
|
||||
(GetResRef(OBJECT_SELF) == "humanbandit_003") ||
|
||||
(GetResRef(OBJECT_SELF) == "humanbandit_004") ||
|
||||
(GetResRef(OBJECT_SELF) == "humanbandit_005") ||
|
||||
(GetResRef(OBJECT_SELF) == "elvenraider001") ||
|
||||
(GetResRef(OBJECT_SELF) == "warrensthug001") ||
|
||||
(GetResRef(OBJECT_SELF) == "ar_gulgslaver002") ||
|
||||
(GetResRef(OBJECT_SELF) == "ar_gulgslaver003") ||
|
||||
(GetResRef(OBJECT_SELF) == "ar_gulgslaver004"))
|
||||
{
|
||||
RndBanditArmor(OBJECT_SELF);
|
||||
ActionEquipMostEffectiveArmor();
|
||||
}
|
||||
|
||||
//:: Regeneration (not Fast Healing)
|
||||
if(sResRef == "ra_troll001" || sResRef == "TROLL_FEDORLA")
|
||||
{
|
||||
//:: Setting local variable for tracking Subdual damage
|
||||
SetLocalInt(OBJECT_SELF, "nSubDual", 0);
|
||||
|
||||
//:: OPTIONAL BEHAVIOR - Fire User Defined Event 1001
|
||||
SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT);
|
||||
|
||||
//:: OPTIONAL BEHAVIOR - Fire User Defined Event 1003
|
||||
SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT);
|
||||
|
||||
//:: OPTIONAL BEHAVIOR - Fire User Defined Event 1006
|
||||
SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT);
|
||||
|
||||
//:: OPTIONAL BEHAVIOR - Fire User Defined Event 1007
|
||||
SetSpawnInCondition(NW_FLAG_DEATH_EVENT);
|
||||
}
|
||||
|
||||
//Post Spawn event request
|
||||
if (nSpecEvent == 2 || nSpecEvent == 3)
|
||||
{
|
||||
SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN));
|
||||
}
|
||||
|
||||
//:: Creature will gain 2 HD for every PC over 4 in an area.
|
||||
int nAutoSolo = GetLocalInt(OBJECT_SELF,"AUTOSOLO");
|
||||
if (nAutoSolo > 0 )
|
||||
{
|
||||
int iNewHD = GetNewAutoSoloHitDice(OBJECT_SELF);
|
||||
int iNewHP = GetNewAutoSoloHitPoints(OBJECT_SELF);
|
||||
|
||||
JSONAutoSolo(OBJECT_SELF, iNewHD, iNewHP);
|
||||
}
|
||||
|
||||
/* //:: Handles class level based NPC titles
|
||||
int bClassTitle = GetLocalInt(OBJECT_SELF,"CLASS_TITLE");
|
||||
if(bClassTitle)
|
||||
{
|
||||
int nHighClass = GetHighestClassLevel(OBJECT_SELF);
|
||||
string sBaseRace = GetLocalString(OBJECT_SELF,"BASE_RACE");
|
||||
|
||||
DelayCommand(0.0f, SetName(OBJECT_SELF, sBaseRace +" "+ GetClassLevelTitle(nHighClass)));
|
||||
} */
|
||||
|
||||
//:: Execute OnSpawn script.
|
||||
if (sResRef == "monst_spider004")
|
||||
{
|
||||
//:: Execute drop in from above spawn.
|
||||
ExecuteScript("nw_c2_dropin9", OBJECT_SELF);
|
||||
}
|
||||
else
|
||||
{
|
||||
//:: Execute CODI AI OnSpawn script.
|
||||
ExecuteScript(sSpawnType, OBJECT_SELF);
|
||||
|
||||
//:: Execute default OnSpawn script.
|
||||
//ExecuteScript("nw_c2_default9", OBJECT_SELF);
|
||||
}
|
||||
|
||||
//:: Execute PRC OnSpawn script.
|
||||
ExecuteScript("prc_npc_spawn", OBJECT_SELF);
|
||||
|
||||
}
|
34
_module/nss/ds_ai_onspelled.nss
Normal file
34
_module/nss/ds_ai_onspelled.nss
Normal file
@@ -0,0 +1,34 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name ds_ai_onspelled
|
||||
//:: Copyright (c) 2022 Project RATDOG
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnSpellCastAt event script caller to run
|
||||
CODI AI & PRC events.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20221201
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// GZ: 2003-10-16
|
||||
// Make Plot Creatures Ignore Attacks
|
||||
//--------------------------------------------------------------------------
|
||||
if (GetPlotFlag(OBJECT_SELF))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//:: Execute the CODI AI NPC OnSpellCastAt script
|
||||
ExecuteScript("no_ai_spt", OBJECT_SELF);
|
||||
|
||||
//:: Execute the Default NPC OnSpellCastAt script
|
||||
//ExecuteScript("nw_c2_defaultb", OBJECT_SELF);
|
||||
|
||||
//:: Execute the PRC NPC OnSpellCastAt script
|
||||
ExecuteScript("prc_npc_spellat", OBJECT_SELF);
|
||||
}
|
169
_module/nss/ds_ai_userdef.nss
Normal file
169
_module/nss/ds_ai_userdef.nss
Normal file
@@ -0,0 +1,169 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name ds_ai_userdef
|
||||
//:: Copyright (c) 2022 Project RATDOG
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
NPC OnUserDefined event script caller to run
|
||||
CODI AI & PRC events.
|
||||
|
||||
May need to actually disable most of this for
|
||||
the CODI AI.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20221201
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
const int EVENT_USER_DEFINED_PRESPAWN = 1510;
|
||||
const int EVENT_USER_DEFINED_POSTSPAWN = 1511;
|
||||
|
||||
void main()
|
||||
{
|
||||
//:: Declare major variables
|
||||
int nUser = GetUserDefinedEventNumber();
|
||||
int nFireDamage = 0;
|
||||
int nAcidDamage = 0;
|
||||
int nColdDamage = 0;
|
||||
int nDivineDamage = 0;
|
||||
int nElectricalDamage = 0;
|
||||
int nPositiveDamage = 0;
|
||||
int nNegativeDamage = 0;
|
||||
int nMagicalDamage = 0;
|
||||
int nSonicDamage = 0;
|
||||
|
||||
string sResRef = GetResRef(OBJECT_SELF);
|
||||
|
||||
effect eSleep = EffectSleep();
|
||||
effect eSlow = EffectSlow();
|
||||
|
||||
if(nUser == EVENT_HEARTBEAT ) //HEARTBEAT
|
||||
{
|
||||
if(sResRef == "ra_troll001" || sResRef == "TROLL_FEDORLA")
|
||||
{
|
||||
if(GetLocalInt(OBJECT_SELF, "nSubDual") > 0)
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF, "nSubDual", GetLocalInt(OBJECT_SELF, "nSubDual") - 5);
|
||||
|
||||
if(GetLocalInt(OBJECT_SELF, "nSubDual") < GetCurrentHitPoints(OBJECT_SELF))
|
||||
{
|
||||
RemoveEffect(OBJECT_SELF, eSleep);
|
||||
}
|
||||
//SpeakString("My Subdual is now " + IntToString(GetLocalInt(OBJECT_SELF, "nSubDual")));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(nUser == EVENT_PERCEIVE) // PERCEIVE
|
||||
{
|
||||
|
||||
}
|
||||
else if(nUser == EVENT_END_COMBAT_ROUND) // END OF COMBAT
|
||||
{
|
||||
|
||||
}
|
||||
else if(nUser == EVENT_DIALOGUE) // ON DIALOGUE
|
||||
{
|
||||
|
||||
}
|
||||
else if(nUser == EVENT_ATTACKED) // ATTACKED
|
||||
{
|
||||
|
||||
}
|
||||
else if(nUser == EVENT_DAMAGED) // DAMAGED
|
||||
{
|
||||
//:: Handles swarm immunity to physical weapons
|
||||
if(sResRef == "ds_minkankswrm01" || sResRef == "ds_locustswarm01")
|
||||
{
|
||||
int nTotalDamage = GetTotalDamageDealt();
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_FIRE) > 0)
|
||||
{
|
||||
nFireDamage = GetDamageDealtByType(DAMAGE_TYPE_FIRE);
|
||||
}
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_ACID) > 0)
|
||||
{
|
||||
nAcidDamage = GetDamageDealtByType(DAMAGE_TYPE_ACID);
|
||||
}
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_COLD) > 0)
|
||||
{
|
||||
nColdDamage = GetDamageDealtByType(DAMAGE_TYPE_COLD);
|
||||
}
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_DIVINE) > 0)
|
||||
{
|
||||
nDivineDamage = GetDamageDealtByType(DAMAGE_TYPE_DIVINE);
|
||||
}
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_ELECTRICAL) > 0)
|
||||
{
|
||||
nElectricalDamage = GetDamageDealtByType(DAMAGE_TYPE_ELECTRICAL);
|
||||
}
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_MAGICAL) > 0)
|
||||
{
|
||||
nMagicalDamage = GetDamageDealtByType(DAMAGE_TYPE_MAGICAL);
|
||||
}
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_NEGATIVE) > 0)
|
||||
{
|
||||
nNegativeDamage = GetDamageDealtByType(DAMAGE_TYPE_NEGATIVE);
|
||||
}
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_POSITIVE) > 0)
|
||||
{
|
||||
nPositiveDamage = GetDamageDealtByType(DAMAGE_TYPE_POSITIVE);
|
||||
}
|
||||
|
||||
if(GetDamageDealtByType(DAMAGE_TYPE_SONIC) > 0)
|
||||
{
|
||||
nSonicDamage = GetDamageDealtByType(DAMAGE_TYPE_SONIC);
|
||||
}
|
||||
|
||||
|
||||
int nSubDmg = nTotalDamage - (nFireDamage
|
||||
+ nAcidDamage
|
||||
+ nColdDamage
|
||||
+ nDivineDamage
|
||||
+ nElectricalDamage
|
||||
+ nMagicalDamage
|
||||
+ nNegativeDamage
|
||||
+ nPositiveDamage
|
||||
+ nSonicDamage);
|
||||
|
||||
int nActDmg = (nFireDamage + nAcidDamage
|
||||
+ nColdDamage
|
||||
+ nDivineDamage
|
||||
+ nElectricalDamage
|
||||
+ nMagicalDamage
|
||||
+ nNegativeDamage
|
||||
+ nPositiveDamage
|
||||
+ nSonicDamage);
|
||||
|
||||
effect eHeal = EffectHeal(nSubDmg);
|
||||
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, OBJECT_SELF, 0.0f);
|
||||
|
||||
}
|
||||
}
|
||||
else if(nUser == 1007) // DEATH - do not use for critical code, does not fire reliably all the time
|
||||
{
|
||||
|
||||
}
|
||||
else if(nUser == EVENT_DISTURBED) // DISTURBED
|
||||
{
|
||||
|
||||
}
|
||||
else if (nUser == EVENT_USER_DEFINED_PRESPAWN)
|
||||
{
|
||||
|
||||
}
|
||||
else if (nUser == EVENT_USER_DEFINED_POSTSPAWN)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//:: Execute the PRC NPC OnUserDef script
|
||||
ExecuteScript("prc_npc_userdef", OBJECT_SELF);
|
||||
|
||||
}
|
513
_module/nss/ds_rnd_armor_inc.nss
Normal file
513
_module/nss/ds_rnd_armor_inc.nss
Normal file
@@ -0,0 +1,513 @@
|
||||
//
|
||||
// NWN Dark Sun Random Armor Include
|
||||
// DS_RND_ARMOR_INC
|
||||
//
|
||||
// By: Jaysyn
|
||||
//
|
||||
|
||||
//void main(){}
|
||||
|
||||
|
||||
void RndVAGrdArmor(object oNPC)
|
||||
{
|
||||
//Randomizes Armor
|
||||
|
||||
int nResult = d6(1);
|
||||
int nStackSize = 1; // Create 1 items;
|
||||
|
||||
string sItem;
|
||||
|
||||
if (nResult == 1)
|
||||
{
|
||||
sItem = "AR_APLTSL_DEARTH";
|
||||
}
|
||||
else if(nResult == 2)
|
||||
{
|
||||
sItem = "AR_APLTSL_DFIRE";
|
||||
}
|
||||
else if(nResult == 3)
|
||||
{
|
||||
sItem = "AR_APLTSL_DMAGMA";
|
||||
}
|
||||
else if(nResult ==4)
|
||||
{
|
||||
sItem = "AR_APLTSL_DRAIN";
|
||||
}
|
||||
else if(nResult == 5)
|
||||
{
|
||||
sItem = "AR_APLTSL_DSILT";
|
||||
}
|
||||
else
|
||||
sItem = "AR_APLTSL_DWATER";
|
||||
|
||||
CreateItemOnObject(sItem, OBJECT_SELF, nStackSize);
|
||||
|
||||
// Loop the object's inventory and equip the first
|
||||
object oItem = GetFirstItemInInventory(oNPC);
|
||||
while(GetIsObjectValid(oItem))
|
||||
{
|
||||
// Check if armor, of course
|
||||
if(GetBaseItemType(oItem) == BASE_ITEM_ARMOR)
|
||||
{
|
||||
// Equip it and stop the script
|
||||
DelayCommand(0.1f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
||||
return;
|
||||
}
|
||||
|
||||
oItem = GetNextItemInInventory(oNPC);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void RndVAWizArmor(object oNPC)
|
||||
{
|
||||
//Randomizes Armor
|
||||
int nResult = d6(1);
|
||||
int nStackSize = 1; // Create 1 items;
|
||||
|
||||
string sItem;
|
||||
|
||||
if (nResult == 1)
|
||||
{
|
||||
sItem = "AR_APCLRB_ESSENC";
|
||||
}
|
||||
else if(nResult == 2)
|
||||
{
|
||||
sItem = "AR_AMCLRB_ADVENT";
|
||||
}
|
||||
else if(nResult == 3)
|
||||
{
|
||||
sItem = "AR_AMCLRB_WIZBAT";
|
||||
}
|
||||
else if(nResult ==4)
|
||||
{
|
||||
sItem = "AR_AMCLRB_MYSTIC";
|
||||
}
|
||||
else if(nResult == 5)
|
||||
{
|
||||
sItem = "AR_AMCLRB_ENLIGH";
|
||||
}
|
||||
else
|
||||
sItem = "AR_APCLTG_DSILT";
|
||||
|
||||
CreateItemOnObject(sItem, oNPC, nStackSize);
|
||||
|
||||
// Loop the object's inventory and equip the first
|
||||
object oItem = GetFirstItemInInventory(oNPC);
|
||||
while(GetIsObjectValid(oItem))
|
||||
{
|
||||
// Check if armor, of course
|
||||
if(GetBaseItemType(oItem) == BASE_ITEM_ARMOR)
|
||||
{
|
||||
// Equip it and stop the script
|
||||
DelayCommand(0.1f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
||||
return;
|
||||
}
|
||||
|
||||
oItem = GetNextItemInInventory(oNPC);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void RndPirateArmor(object oNPC)
|
||||
{
|
||||
//Randomizes Armor
|
||||
|
||||
int nResult = d6(1);
|
||||
int nStackSize = 1; // Create 1 items;
|
||||
|
||||
string sItem;
|
||||
|
||||
if (nResult == 1)
|
||||
{
|
||||
sItem = "DS_ALTSL_PIRATE1";
|
||||
}
|
||||
else if(nResult == 2)
|
||||
{
|
||||
sItem = "DS_ALTSL_PIRATE2";
|
||||
}
|
||||
else if(nResult == 3)
|
||||
{
|
||||
sItem = "DS_ALTSL_PIRATE3";
|
||||
}
|
||||
else if(nResult ==4)
|
||||
{
|
||||
sItem = "DS_ALTSL_PIRATE4";
|
||||
}
|
||||
else if(nResult == 5)
|
||||
{
|
||||
sItem = "DS_ALTSL_PIRATE5";
|
||||
}
|
||||
else
|
||||
sItem = "AR_ACLCL_HARNESS";
|
||||
|
||||
CreateItemOnObject(sItem, oNPC, nStackSize);
|
||||
|
||||
// Loop the object's inventory and equip the first
|
||||
object oItem = GetFirstItemInInventory(oNPC);
|
||||
while(GetIsObjectValid(oItem))
|
||||
{
|
||||
// Check if armor, of course
|
||||
if(GetBaseItemType(oItem) == BASE_ITEM_ARMOR)
|
||||
{
|
||||
// Equip it and stop the script
|
||||
DelayCommand(0.1f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
||||
DelayCommand(0.2f, SetDroppableFlag(oItem, FALSE));
|
||||
return;
|
||||
}
|
||||
|
||||
oItem = GetNextItemInInventory(oNPC);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void RndBanditArmor(object oNPC)
|
||||
{ //Randomizes Armor
|
||||
int nResult = d8(1);
|
||||
int nStackSize = 1; // Create 1 items;
|
||||
|
||||
string sItem;
|
||||
|
||||
if (nResult == 1) { sItem = "NW_AARCL009"; } //:: Padded Armor (NWN)
|
||||
else if(nResult == 2) { sItem = "AR_ALTSL_BONE01"; } //:: Bone-studded Leather Armor
|
||||
else if(nResult == 3) { sItem = "AR_ALTLT_CATSUIT"; } //:: Cat Suit (Leather)
|
||||
else if(nResult == 4) { sItem = "AR_ACLCL_HARNESS"; } //:: Harness (Padded)
|
||||
else if(nResult == 5) { sItem = "AR_ALTLT_LEATHER"; } //:: Leather Armor
|
||||
else if(nResult == 6) { sItem = "DS_ALTLT_BANDIT1"; } //:: Bandit Armor (Padded)
|
||||
else if(nResult == 7) { sItem = "DS_ALTLT_BANDIT2"; } //:: Bandit Armor (Leather)
|
||||
else sItem = "AR_ALTPD_CLOTH01"; //:: Padded Armor
|
||||
|
||||
CreateItemOnObject(sItem, oNPC, nStackSize);
|
||||
|
||||
// Loop the object's inventory and equip the first
|
||||
object oItem = GetFirstItemInInventory(oNPC);
|
||||
while(GetIsObjectValid(oItem))
|
||||
{
|
||||
// Check if armor, of course
|
||||
if(GetBaseItemType(oItem) == BASE_ITEM_ARMOR)
|
||||
{
|
||||
// Equip it and stop the script
|
||||
DelayCommand(0.1f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
||||
DelayCommand(0.2f, SetDroppableFlag(oItem, FALSE));
|
||||
return;
|
||||
}
|
||||
|
||||
oItem = GetNextItemInInventory(oNPC);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void RndLightArmor(object oNPC)
|
||||
{
|
||||
//Randomizes Armor
|
||||
|
||||
int nResult = d8(1);
|
||||
int nStackSize = 1; // Create 1 items;
|
||||
|
||||
string sItem;
|
||||
|
||||
if (nResult == 1)
|
||||
{
|
||||
sItem = "aarcl002";
|
||||
}
|
||||
else if(nResult == 2)
|
||||
{
|
||||
sItem = "baleas_cloth019";
|
||||
}
|
||||
else if(nResult == 3)
|
||||
{
|
||||
sItem = "aarcl004";
|
||||
}
|
||||
else if(nResult ==4)
|
||||
{
|
||||
sItem = "zep_studdedleath";
|
||||
}
|
||||
else if(nResult == 5)
|
||||
{
|
||||
sItem = "aarcl004";
|
||||
}
|
||||
else if(nResult == 6)
|
||||
{
|
||||
sItem = "nw_aarcl001";
|
||||
}
|
||||
else if(nResult == 7)
|
||||
{
|
||||
sItem = "nw_aarcl002";
|
||||
}
|
||||
else
|
||||
sItem = "nw_aarcl009";
|
||||
|
||||
CreateItemOnObject(sItem, oNPC, nStackSize);
|
||||
|
||||
// Loop the object's inventory and equip the first
|
||||
object oItem = GetFirstItemInInventory(oNPC);
|
||||
while(GetIsObjectValid(oItem))
|
||||
{
|
||||
// Check if armor, of course
|
||||
if(GetBaseItemType(oItem) == BASE_ITEM_ARMOR)
|
||||
{
|
||||
// Equip it and stop the script
|
||||
DelayCommand(0.1f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
||||
return;
|
||||
}
|
||||
|
||||
oItem = GetNextItemInInventory(oNPC);
|
||||
}
|
||||
}
|
||||
|
||||
void RndDwarfGuardArmor(object oNPC)
|
||||
{
|
||||
|
||||
//Randomizes Armor
|
||||
|
||||
int nResult = d6(1);
|
||||
int nStackSize = 1; // Create 1 items;
|
||||
|
||||
string sItem;
|
||||
|
||||
if (nResult == 1)
|
||||
{
|
||||
sItem = "AR_ALTSL_BONE01";
|
||||
}
|
||||
else if(nResult == 2)
|
||||
{
|
||||
sItem = "AR_ALTSL_IVORY";
|
||||
}
|
||||
else if(nResult == 3)
|
||||
{
|
||||
sItem = "DS_AMDBP_KLED001";
|
||||
}
|
||||
else if(nResult ==4)
|
||||
{
|
||||
sItem = "AR_ALTLT_MEKILOT";
|
||||
}
|
||||
else if(nResult == 5)
|
||||
{
|
||||
sItem = "DS_AMDBP_KLED002";
|
||||
}
|
||||
else
|
||||
sItem = "DS_AMDBP_KLED003";
|
||||
|
||||
CreateItemOnObject(sItem, oNPC, nStackSize);
|
||||
|
||||
// Loop the object's inventory and equip the first
|
||||
object oItem = GetFirstItemInInventory(oNPC);
|
||||
while(GetIsObjectValid(oItem))
|
||||
{
|
||||
// Check if armor, of course
|
||||
if(GetBaseItemType(oItem) == BASE_ITEM_ARMOR)
|
||||
{
|
||||
// Equip it and stop the script
|
||||
DelayCommand(0.1f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
||||
return;
|
||||
}
|
||||
|
||||
oItem = GetNextItemInInventory(oNPC);
|
||||
}
|
||||
}
|
||||
|
||||
void RndGuardArmor(object oNPC)
|
||||
{
|
||||
//Randomizes Armor
|
||||
|
||||
int nResult = d6(1);
|
||||
int nStackSize = 1; // Create 1 items;
|
||||
|
||||
string sItem;
|
||||
|
||||
if (nResult == 1)
|
||||
{
|
||||
sItem = "AR_ALTSL_BONE01";
|
||||
}
|
||||
else if(nResult == 2)
|
||||
{
|
||||
sItem = "AR_ALTSL_IVORY";
|
||||
}
|
||||
else if(nResult == 3)
|
||||
{
|
||||
sItem = "AR_ALTLT_LEATHER";
|
||||
}
|
||||
else if(nResult ==4)
|
||||
{
|
||||
sItem = "AR_ALTLT_MEKILOT";
|
||||
}
|
||||
else if(nResult == 5)
|
||||
{
|
||||
sItem = "AR_ALTPD_CLOTH01";
|
||||
}
|
||||
else
|
||||
sItem = "AR_ACLCL_HARNESS";
|
||||
|
||||
CreateItemOnObject(sItem, oNPC, nStackSize);
|
||||
|
||||
// Loop the object's inventory and equip the first
|
||||
object oItem = GetFirstItemInInventory(oNPC);
|
||||
while(GetIsObjectValid(oItem))
|
||||
{
|
||||
// Check if armor, of course
|
||||
if(GetBaseItemType(oItem) == BASE_ITEM_ARMOR)
|
||||
{
|
||||
// Equip it and stop the script
|
||||
DelayCommand(0.1f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
||||
return;
|
||||
}
|
||||
|
||||
oItem = GetNextItemInInventory(oNPC);
|
||||
}
|
||||
}
|
||||
|
||||
void RndFighterArmor(object oNPC)
|
||||
{
|
||||
|
||||
//Randomizes Armor
|
||||
|
||||
int nResult = d10(1);
|
||||
int nStackSize = 1; // Create 1 items;
|
||||
|
||||
string sItem;
|
||||
|
||||
if (nResult == 1)
|
||||
{
|
||||
sItem = "nw_aarcl011";
|
||||
}
|
||||
else if(nResult == 2)
|
||||
{
|
||||
sItem = "nw_aarcl006";
|
||||
}
|
||||
else if(nResult == 3)
|
||||
{
|
||||
sItem = "nw_aarcl005";
|
||||
}
|
||||
else if(nResult ==4)
|
||||
{
|
||||
sItem = "nw_aarcl010";
|
||||
}
|
||||
else if(nResult == 5)
|
||||
{
|
||||
sItem = "nw_aarcl004";
|
||||
}
|
||||
else if(nResult == 6)
|
||||
{
|
||||
sItem = "nw_aarcl003";
|
||||
}
|
||||
else if(nResult == 7)
|
||||
{
|
||||
sItem = "nw_aarcl012";
|
||||
}
|
||||
else if(nResult == 8)
|
||||
{
|
||||
sItem = "chainmail_st";
|
||||
}
|
||||
else if(nResult == 9)
|
||||
{
|
||||
sItem = "scale_st";
|
||||
}
|
||||
else
|
||||
sItem = "aarcl007";
|
||||
|
||||
CreateItemOnObject(sItem, oNPC, nStackSize);
|
||||
|
||||
// Loop the object's inventory and equip the first
|
||||
object oItem = GetFirstItemInInventory(oNPC);
|
||||
while(GetIsObjectValid(oItem))
|
||||
{
|
||||
// Check if armor, of course
|
||||
if(GetBaseItemType(oItem) == BASE_ITEM_ARMOR)
|
||||
{
|
||||
// Equip it and stop the script
|
||||
DelayCommand(0.1f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
||||
return;
|
||||
}
|
||||
|
||||
oItem = GetNextItemInInventory(oNPC);
|
||||
}
|
||||
}
|
||||
|
||||
void RndEscortClothes(object oNPC)
|
||||
{
|
||||
|
||||
//:: Randomizes "sexy" clothing for escorts
|
||||
|
||||
int nGender = GetGender(oNPC);
|
||||
int nResult = d6(1);
|
||||
int nStackSize = 1; // Create 1 items;
|
||||
|
||||
string sItem;
|
||||
|
||||
if(nGender > 0)
|
||||
{
|
||||
if (nResult == 1)
|
||||
{
|
||||
sItem = "ds_aclcl_xotic01";
|
||||
}
|
||||
|
||||
else if(nResult == 2)
|
||||
{
|
||||
sItem = "ds_aclcl_xotic02";
|
||||
}
|
||||
|
||||
else if(nResult == 3)
|
||||
{
|
||||
sItem = "ds_aclcl_xotic03";
|
||||
}
|
||||
|
||||
else if(nResult ==4)
|
||||
{
|
||||
sItem = "ds_aclcl_xotic04";
|
||||
}
|
||||
|
||||
else if(nResult == 5)
|
||||
{
|
||||
sItem = "ds_aclcl_xotic05";
|
||||
}
|
||||
|
||||
else sItem = "ds_aclcl_xotic06";
|
||||
}
|
||||
|
||||
if(nGender < 1)
|
||||
{
|
||||
if (nResult == 1)
|
||||
{
|
||||
sItem = "ds_aclcl_xotic07";
|
||||
}
|
||||
|
||||
else if(nResult == 2)
|
||||
{
|
||||
sItem = "ds_aclcl_xotic08";
|
||||
}
|
||||
|
||||
else if(nResult == 3)
|
||||
{
|
||||
sItem = "ds_aclcl_xotic09";
|
||||
}
|
||||
|
||||
else if(nResult ==4)
|
||||
{
|
||||
sItem = "ds_aclcl_xotic10";
|
||||
}
|
||||
|
||||
else if(nResult == 5)
|
||||
{
|
||||
sItem = "ds_aclcl_xotic11";
|
||||
}
|
||||
|
||||
else sItem = "ds_aclcl_xotic12";
|
||||
}
|
||||
|
||||
CreateItemOnObject(sItem, oNPC, nStackSize);
|
||||
|
||||
// Loop the object's inventory and equip the first
|
||||
object oItem = GetFirstItemInInventory(oNPC);
|
||||
while(GetIsObjectValid(oItem))
|
||||
{
|
||||
// Check if armor, of course
|
||||
if(GetBaseItemType(oItem) == BASE_ITEM_ARMOR)
|
||||
{
|
||||
// Equip it and stop the script
|
||||
DelayCommand(0.1f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
||||
return;
|
||||
}
|
||||
|
||||
oItem = GetNextItemInInventory(oNPC);
|
||||
}
|
||||
}
|
579
_module/nss/ds_rnd_level.nss
Normal file
579
_module/nss/ds_rnd_level.nss
Normal file
@@ -0,0 +1,579 @@
|
||||
//:: ds_rnd_level.nss
|
||||
#include "prc_inc_util"
|
||||
#include "x0_i0_treasure"
|
||||
#include "nwnx_creature"
|
||||
#include "nw_inc_gff"
|
||||
|
||||
//void main(){}
|
||||
|
||||
int GetNewAutoSoloHitDice(object oNPC);
|
||||
int GetNewAutoSoloHitPoints(object oNPC);
|
||||
void JSONAutoSolo(object oCreature, int iNewHD, int iNewHP);
|
||||
int GetClassHDType(object oNPC);
|
||||
void DisplayClass(int iClass);
|
||||
void DisplayPackage(int iPackage);
|
||||
void LevelMob(object oCreature, int iLevel);
|
||||
int GetPackage(int iClass);
|
||||
|
||||
int GetNewAutoSoloHitDice(object oNPC)
|
||||
{
|
||||
int nTotalPCs = 0;
|
||||
int nHDBoost = 0;
|
||||
int iNewHD = 0;
|
||||
int nMaxHD = GetLocalInt(OBJECT_SELF,"MAXHD");
|
||||
int nHD = GetHitDice(OBJECT_SELF);
|
||||
|
||||
object oArea = GetArea(OBJECT_SELF);
|
||||
|
||||
string sAreaName = GetName(oArea);
|
||||
|
||||
//:: Cycle through PCs in Area
|
||||
object oPC = GetFirstObjectInArea(oArea);
|
||||
|
||||
//SendMessageToPC(oPC, "OnSpawn: AutoSoloHD is running in "+sAreaName+".");
|
||||
//SendMessageToAllDMs("OnSpawn: AutoSoloHD is running in "+sAreaName+".");
|
||||
//WriteTimestampedLogEntry("OnSpawn: AutoSoloHD is running in "+sAreaName+".");
|
||||
|
||||
while (oPC != OBJECT_INVALID)
|
||||
{
|
||||
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
||||
{
|
||||
nTotalPCs++;
|
||||
}
|
||||
|
||||
oPC = GetNextObjectInArea(oArea);
|
||||
}
|
||||
|
||||
if (nTotalPCs > 4)
|
||||
{nHDBoost = (nTotalPCs-3)*2;}
|
||||
|
||||
iNewHD = nHDBoost + nHD;
|
||||
|
||||
if(nMaxHD > 0)
|
||||
{
|
||||
if(iNewHD > nMaxHD)
|
||||
{iNewHD = nMaxHD;}
|
||||
}
|
||||
|
||||
//:: Return updated HD
|
||||
//SendMessageToPC(oPC, "OnSpawn: AutoSoloHD is adding "+IntToString(nHDBoost)+" Hit Dice for a total of "+IntToString(iNewHD)+".");
|
||||
//SendMessageToAllDMs("OnSpawn: AutoSoloHD is adding "+IntToString(nHDBoost)+" Hit Dice for a total of "+IntToString(iNewHD)+".");
|
||||
//WriteTimestampedLogEntry("OnSpawn: AutoSoloHD is adding "+IntToString(nHDBoost)+" Hit Dice for a total of "+IntToString(iNewHD)+".");
|
||||
return iNewHD;
|
||||
|
||||
//DelayCommand(0.0f, NWNX_Creature_SetLevelByPosition(OBJECT_SELF, 1, iNewHD));
|
||||
//DelayCommand(0.1f, SetCurrentHitPoints(OBJECT_SELF, iNewHP));
|
||||
|
||||
}
|
||||
|
||||
int GetNewAutoSoloHitPoints(object oNPC)
|
||||
{
|
||||
int nTotalPCs = 0;
|
||||
int nHDBoost = 0;
|
||||
int nHPBoost = 0;
|
||||
int iNewHP = 0;
|
||||
int iNewHD = 0;
|
||||
int nMaxHD = GetLocalInt(OBJECT_SELF,"MAXHD");
|
||||
int nHD = GetHitDice(OBJECT_SELF);
|
||||
int nCurrentHP = GetCurrentHitPoints(OBJECT_SELF);
|
||||
int nHDType = GetClassHDType(OBJECT_SELF);
|
||||
|
||||
object oArea = GetArea(OBJECT_SELF);
|
||||
|
||||
string sAreaName = GetName(oArea);
|
||||
|
||||
//:: Cycle through PCs in Area
|
||||
object oPC = GetFirstObjectInArea(oArea);
|
||||
|
||||
//SendMessageToPC(oPC, "OnSpawn: AutoSoloHP is running in "+sAreaName+".");
|
||||
//SendMessageToAllDMs("OnSpawn: AutoSoloHP is running in "+sAreaName+".");
|
||||
//WriteTimestampedLogEntry("OnSpawn: AutoSoloHP is running in "+sAreaName+".");
|
||||
|
||||
while (oPC != OBJECT_INVALID)
|
||||
{
|
||||
if (GetIsPC(oPC) == TRUE || GetIsPC(GetMaster(oPC)) == TRUE) //:: Summons & henchmen should count towards this.
|
||||
{
|
||||
nTotalPCs++;
|
||||
}
|
||||
|
||||
oPC = GetNextObjectInArea(oArea);
|
||||
}
|
||||
|
||||
if (nTotalPCs > 4)
|
||||
{nHDBoost = (nTotalPCs-3)*2;}
|
||||
|
||||
iNewHD = nHDBoost + nHD;
|
||||
|
||||
if(nMaxHD > 0)
|
||||
{
|
||||
if(iNewHD > nMaxHD)
|
||||
{iNewHD = nMaxHD;}
|
||||
}
|
||||
|
||||
//:: Calculate new HP
|
||||
nHPBoost = nHDBoost * nHDType;
|
||||
iNewHP = nCurrentHP + nHPBoost;
|
||||
|
||||
//:: Return updated HP
|
||||
//SendMessageToPC(oPC, "OnSpawn: AutoSoloHP is adding "+IntToString(nHPBoost)+" Hit Points for a total of "+IntToString(iNewHP)+".");
|
||||
//SendMessageToAllDMs("OnSpawn: AutoSoloHP is adding "+IntToString(nHPBoost)+" Hit Points for a total of "+IntToString(iNewHP)+".");
|
||||
//WriteTimestampedLogEntry("OnSpawn: AutoSoloHP is adding "+IntToString(nHPBoost)+" Hit Points for a total of "+IntToString(iNewHP)+".");
|
||||
return iNewHP;
|
||||
//DelayCommand(0.0f, NWNX_Creature_SetLevelByPosition(OBJECT_SELF, 1, iNewHD));
|
||||
//DelayCommand(0.1f, SetCurrentHitPoints(OBJECT_SELF, iNewHP));
|
||||
|
||||
}
|
||||
|
||||
void JSONAutoSolo(object oCreature, int iNewHD, int iNewHP)
|
||||
{
|
||||
int iRanOnce = GetLocalInt(oCreature,"AUTOSOLO_HAS_RAN");
|
||||
if (iRanOnce > 0 )
|
||||
{
|
||||
//SendMessageToAllDMs("ERROR: AutoSolo has already processed this creature.");
|
||||
//WriteTimestampedLogEntry("ERROR: AutoSolo has already processed this creature.");
|
||||
return;
|
||||
}
|
||||
|
||||
json jCreature = ObjectToJson(oCreature, TRUE);
|
||||
json jGet;
|
||||
|
||||
/* // Retrieve the key
|
||||
jGet = JsonObjectGet(jCreature, "ClassList/value/0/ClassLevel");
|
||||
|
||||
if(JsonGetType(jGet) == JSON_TYPE_NULL)
|
||||
{
|
||||
SpeakString("JsonObjectGet error 1: " + JsonGetError(jGet));
|
||||
WriteTimestampedLogEntry("JsonObjectGet error 1: " + JsonGetError(jGet));
|
||||
} */
|
||||
|
||||
//WriteTimestampedLogEntry("First JSON Dump for "+GetName(OBJECT_SELF)+".");
|
||||
//WriteTimestampedLogEntry(JsonDump(jCreature, 2));
|
||||
jCreature = GffReplaceShort(jCreature, "ClassList/value/0/ClassLevel", iNewHD);
|
||||
//WriteTimestampedLogEntry("Second JSON Dump for "+GetName(OBJECT_SELF)+".");
|
||||
//WriteTimestampedLogEntry(JsonDump(jCreature, 2));
|
||||
|
||||
//:: New creature generation
|
||||
object oNewCreature = JsonToObject(jCreature, GetLocation(oCreature), OBJECT_INVALID, TRUE);
|
||||
SetCurrentHitPoints(oNewCreature, iNewHP);
|
||||
SetLocalInt(oNewCreature, "AUTOSOLO_HAS_RAN", 1);
|
||||
SetLocalInt(oCreature, "AUTOSOLO_HAS_RAN", 1);
|
||||
SetLocalInt(oCreature, "DELETE_ME", 1);
|
||||
DeleteLocalInt(oNewCreature, "AUTOSOLO");
|
||||
DeleteLocalInt(oCreature, "AUTOSOLO");
|
||||
|
||||
|
||||
//:: Destroy original creature
|
||||
AssignCommand(oCreature, ClearAllActions(TRUE));
|
||||
DestroyObject(oCreature, 0.0f);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
int GetClassHDType(object oNPC)
|
||||
{
|
||||
int nClass = GetClassByPosition(1, oNPC);
|
||||
|
||||
if (nClass == CLASS_TYPE_INVALID)
|
||||
return 0; // Unknown class or invalid position
|
||||
|
||||
string sHitDice = Get2DAString("classes", "HitDie", nClass);
|
||||
|
||||
if (sHitDice == "")
|
||||
return 0; // Hit dice not found
|
||||
|
||||
//SendMessageToPC(oNPC, "GetClassHDType: "+sHitDice+".");
|
||||
//SendMessageToAllDMs("GetClassHDType: "+sHitDice+".");
|
||||
//WriteTimestampedLogEntry("GetClassHDType: "+sHitDice+".");
|
||||
|
||||
return StringToInt(sHitDice);
|
||||
}
|
||||
|
||||
void DisplayClass(int iClass)
|
||||
{
|
||||
string classNameStrRef = Get2DAString("classes", "Name", iClass);
|
||||
int strRef = StringToInt(classNameStrRef);
|
||||
string className = GetStringByStrRef(strRef);
|
||||
DelayCommand(0.0f, SendMessageToAllDMs("ds_rnd_level: Class " + className + " found at last position."));
|
||||
}
|
||||
|
||||
void DisplayPackage(int iPackage)
|
||||
{
|
||||
string packageNameStrRef = Get2DAString("packages", "Name", iPackage);
|
||||
int strRef = StringToInt(packageNameStrRef);
|
||||
string packageName = GetStringByStrRef(strRef);
|
||||
DelayCommand(0.0f, SendMessageToAllDMs("ds_rnd_level: Package " + packageName + " set."));
|
||||
WriteTimestampedLogEntry("ds_rnd_level: Package " + packageName + " set.");
|
||||
}
|
||||
|
||||
void LevelMob(object oCreature, int iLevel)
|
||||
{
|
||||
int iIndex;
|
||||
int iClass;
|
||||
int iPackage;
|
||||
|
||||
//:: Determine if Class Package should be randomized
|
||||
int iRandPack = GetLocalInt(OBJECT_SELF, "RANDOM_PACKAGE");
|
||||
|
||||
//:: Get the current Hit Dice of the creature.
|
||||
int iCreHD = GetHitDice(oCreature);
|
||||
|
||||
//:: Get the max and min Hit Dice for this creature
|
||||
int iMax = GetLocalInt(OBJECT_SELF, "MAXHD");
|
||||
int iMin = GetLocalInt(OBJECT_SELF, "MINHD");
|
||||
if(iMax == 0)iMax = 60; //:: Creatures have a max of 60 HD
|
||||
if(iMin == 0)iMin = 3;
|
||||
|
||||
//:: Check the ranges so we dont go above max, or below min.
|
||||
if(iLevel < iMin) iLevel = iMin;
|
||||
if(iLevel > iMax) iLevel = iMax;
|
||||
|
||||
//:: Sanity Check. Reduce the creature to 1 Hit die. (AutoLevel still won't work on a creature w/ two classes w/ HenchmanLevelUp.)
|
||||
DelayCommand(0.0f, NWNX_Creature_LevelDown(oCreature, iCreHD-1));
|
||||
|
||||
//:: Get the current Hit Dice of the creature, again. Should be 1 at this point.
|
||||
iCreHD = GetHitDice(oCreature);
|
||||
|
||||
//:: Get the multiclassing variables to see if we need to change classes from its base class
|
||||
int iClass2Start = GetLocalInt(oCreature, "Class2Start"); //:: Creature HD to begin this class at.
|
||||
int iClass2 = GetLocalInt(oCreature, "Class2"); //:: INT of desired class (i.e. 4 = FIGHTER)
|
||||
int iClass2Pack = GetLocalInt(oCreature, "Class2Pack"); //:: INT of desired package (i.e. 4 = Default Fighter)
|
||||
|
||||
int iClass3Start = GetLocalInt(oCreature, "Class3Start");
|
||||
int iClass3 = GetLocalInt(oCreature, "Class3");
|
||||
int iClass3Pack = GetLocalInt(oCreature, "Class3Pack");
|
||||
|
||||
int iClass4Start = GetLocalInt(oCreature, "Class4Start");
|
||||
int iClass4 = GetLocalInt(oCreature, "Class4");
|
||||
int iClass4Pack = GetLocalInt(oCreature, "Class4Pack");
|
||||
|
||||
int iClass5Start = GetLocalInt(oCreature, "Class5Start");
|
||||
int iClass5 = GetLocalInt(oCreature, "Class5");
|
||||
int iClass5Pack = GetLocalInt(oCreature, "Class5Pack");
|
||||
|
||||
int iClass6Start = GetLocalInt(oCreature, "Class6Start");
|
||||
int iClass6 = GetLocalInt(oCreature, "Class6");
|
||||
int iClass6Pack = GetLocalInt(oCreature, "Class6Pack");
|
||||
|
||||
int iClass7Start = GetLocalInt(oCreature, "Class7Start");
|
||||
int iClass7 = GetLocalInt(oCreature, "Class7");
|
||||
int iClass7Pack = GetLocalInt(oCreature, "Class7Pack");
|
||||
|
||||
int iClass8Start = GetLocalInt(oCreature, "Class8Start");
|
||||
int iClass8 = GetLocalInt(oCreature, "Class8");
|
||||
int iClass8Pack = GetLocalInt(oCreature, "Class8Pack");
|
||||
|
||||
//:: Randomize Class Packages if wanted.
|
||||
if (iRandPack > 0)
|
||||
{
|
||||
iClass2Pack = GetPackage(iClass2);
|
||||
iClass3Pack = GetPackage(iClass3);
|
||||
iClass4Pack = GetPackage(iClass4);
|
||||
iClass5Pack = GetPackage(iClass5);
|
||||
iClass6Pack = GetPackage(iClass6);
|
||||
iClass7Pack = GetPackage(iClass7);
|
||||
iClass8Pack = GetPackage(iClass8);
|
||||
}
|
||||
|
||||
//loop - levels them up to the right spot
|
||||
//check for zero because that's an error
|
||||
//if creatures are not leveling then best bet is they are not legal creatures
|
||||
while( (iCreHD < iLevel) && (iCreHD > 0) )
|
||||
{
|
||||
//check the multiclassing numbers to change classes
|
||||
|
||||
if( (iClass8Start != 0) && (iCreHD >= iClass8Start) )
|
||||
{
|
||||
//level up using the new class and package
|
||||
iCreHD = LevelUpHenchman(oCreature, iClass8 ,TRUE, iClass8Pack);
|
||||
if(iCreHD == 0)SpeakString(GetName(oCreature) + " Failed on 8th class", TALKVOLUME_SHOUT);
|
||||
}
|
||||
else if( (iClass7Start != 0) && (iCreHD >= iClass7Start) )
|
||||
{
|
||||
//level up using the new class and package
|
||||
iCreHD = LevelUpHenchman(oCreature, iClass7 ,TRUE, iClass7Pack);
|
||||
if(iCreHD == 0)SpeakString(GetName(oCreature) + " Failed on 7th class", TALKVOLUME_SHOUT);
|
||||
}
|
||||
|
||||
else if( (iClass6Start != 0) && (iCreHD >= iClass6Start) )
|
||||
{
|
||||
//level up using the new class and package
|
||||
iCreHD = LevelUpHenchman(oCreature, iClass6 ,TRUE, iClass6Pack);
|
||||
if(iCreHD == 0)SpeakString(GetName(oCreature) + " Failed on 6th class", TALKVOLUME_SHOUT);
|
||||
}
|
||||
|
||||
else if( (iClass5Start != 0) && (iCreHD >= iClass5Start) )
|
||||
{
|
||||
//level up using the new class and package
|
||||
iCreHD = LevelUpHenchman(oCreature, iClass5 ,TRUE, iClass5Pack);
|
||||
if(iCreHD == 0)SpeakString(GetName(oCreature) + " Failed on 5th class", TALKVOLUME_SHOUT);
|
||||
}
|
||||
|
||||
else if( (iClass4Start != 0) && (iCreHD >= iClass4Start) )
|
||||
{
|
||||
//level up using the new class and package
|
||||
iCreHD = LevelUpHenchman(oCreature, iClass4 ,TRUE, iClass4Pack);
|
||||
if(iCreHD == 0)SpeakString(GetName(oCreature) + " Failed on 4th class", TALKVOLUME_SHOUT);
|
||||
}
|
||||
else if( (iClass3Start != 0) && (iCreHD >= iClass3Start) )
|
||||
{
|
||||
//level up using the new class and package
|
||||
iCreHD = LevelUpHenchman(oCreature, iClass3 ,TRUE, iClass3Pack);
|
||||
if(iCreHD == 0)SpeakString(GetName(oCreature) + " Failed on third class", TALKVOLUME_SHOUT);
|
||||
}
|
||||
else if( (iClass2Start != 0) && (iCreHD >= iClass2Start) )
|
||||
{
|
||||
//level up using the new class and package
|
||||
iCreHD = LevelUpHenchman(oCreature, iClass2 ,TRUE, iClass2Pack);
|
||||
if(iCreHD == 0)SpeakString(GetName(oCreature) + " Failed on second class", TALKVOLUME_SHOUT);
|
||||
}
|
||||
else
|
||||
{
|
||||
//just level up using the class it already has
|
||||
iCreHD = LevelUpHenchman(oCreature, CLASS_TYPE_INVALID ,TRUE);
|
||||
if(iCreHD == 0)SpeakString(GetName(oCreature) + " Failed to level properly", TALKVOLUME_SHOUT);
|
||||
}
|
||||
}
|
||||
|
||||
//:: Force Rest to mem spells
|
||||
DelayCommand(0.2f, ForceRest(oCreature));
|
||||
|
||||
//:: Give more treasure to be lvl appropriate
|
||||
DelayCommand(0.2f, CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, oCreature));
|
||||
}
|
||||
|
||||
//Setup Random Packages, note that Wizards won't get random packages
|
||||
//so that specific wizard types can be used. Example: Necromancer.
|
||||
int GetPackage(int iClass)
|
||||
{
|
||||
int iPackage;
|
||||
int iRandom;
|
||||
|
||||
iPackage = PACKAGE_INVALID;
|
||||
switch (iClass)
|
||||
{
|
||||
case CLASS_TYPE_ABERRATION:
|
||||
{ iPackage = PACKAGE_ABERRATION; break; }
|
||||
|
||||
break;
|
||||
case CLASS_TYPE_ANIMAL:
|
||||
{ iPackage = PACKAGE_ANIMAL; break; }
|
||||
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_BEAST:
|
||||
{ iPackage = PACKAGE_BEAST; break; }
|
||||
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_COMMONER:
|
||||
{ iPackage = PACKAGE_COMMONER; break; }
|
||||
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_CONSTRUCT:
|
||||
{ iPackage = PACKAGE_CONSTRUCT; break; }
|
||||
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_DRAGON:
|
||||
{ iPackage = PACKAGE_DRAGON; break; }
|
||||
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_ELEMENTAL:
|
||||
{ iPackage = PACKAGE_ELEMENTAL; break; }
|
||||
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_FEY:
|
||||
{ iPackage = PACKAGE_FEY; break; }
|
||||
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_GIANT:
|
||||
{ iPackage = PACKAGE_GIANT; break; }
|
||||
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_HUMANOID:
|
||||
{ iPackage = PACKAGE_HUMANOID; break; }
|
||||
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_MAGICAL_BEAST:
|
||||
{ iPackage = PACKAGE_MAGICBEAST; break; }
|
||||
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_MONSTROUS:
|
||||
{ iPackage = PACKAGE_MONSTROUS; break; }
|
||||
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_OUTSIDER:
|
||||
{ iPackage = PACKAGE_OUTSIDER; break; }
|
||||
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_PLANT:
|
||||
{ iPackage = PACKAGE_BEAST; break; }
|
||||
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_SHAPECHANGER:
|
||||
{ iPackage = PACKAGE_SHAPECHANGER; break; }
|
||||
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_UNDEAD:
|
||||
{ iPackage = PACKAGE_UNDEAD; break; }
|
||||
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_VERMIN:
|
||||
{ iPackage = PACKAGE_VERMIN; break; }
|
||||
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_SORCERER:
|
||||
iRandom=d12(1);
|
||||
switch (iRandom)
|
||||
{
|
||||
case 1: iPackage = PACKAGE_SORCERER; break;
|
||||
case 2: iPackage = PACKAGE_SORCERER_ABJURATION; break;
|
||||
case 3: iPackage = PACKAGE_SORCERER_CONJURATION; break;
|
||||
case 4: iPackage = PACKAGE_SORCERER_DIVINATION; break;
|
||||
case 5: iPackage = PACKAGE_SORCERER_DRAGONDISCIPLE; break;
|
||||
case 6: iPackage = PACKAGE_SORCERER_ENCHANTMENT; break;
|
||||
case 7: iPackage = PACKAGE_SORCERER_EVOCATION; break;
|
||||
case 8: iPackage = PACKAGE_SORCERER_ILLUSION; break;
|
||||
case 9: iPackage = PACKAGE_SORCERER_NECROMANCY; break;
|
||||
case 10: iPackage = PACKAGE_SORCERER_TRANSMUTATION; break;
|
||||
case 11: iPackage = PACKAGE_NPC_SORCERER; break;
|
||||
case 12: iPackage = PACKAGE_SORCERER_DRAGONDISCIPLE; break;
|
||||
}
|
||||
break;
|
||||
case CLASS_TYPE_CLERIC:
|
||||
iRandom=d8(1);
|
||||
switch (iRandom)
|
||||
{
|
||||
case 1: iPackage = PACKAGE_CLERIC; break;
|
||||
case 2: iPackage = PACKAGE_CLERIC_BATTLE_PRIEST; break;
|
||||
case 3: iPackage = PACKAGE_CLERIC_DEADWALKER; break;
|
||||
case 4: iPackage = PACKAGE_CLERIC_DIVINE; break;
|
||||
case 5: iPackage = PACKAGE_CLERIC_ELEMENTALIST; break;
|
||||
case 6: iPackage = PACKAGE_CLERIC_SHAMAN; break;
|
||||
case 7: iPackage = PACKAGE_NPC_CLERIC_LINU; break;
|
||||
case 8: iPackage = PACKAGE_CLERIC; break;
|
||||
}
|
||||
break;
|
||||
case CLASS_TYPE_DRUID:
|
||||
iRandom=d6(1);
|
||||
switch (iRandom)
|
||||
{
|
||||
case 1: iPackage = PACKAGE_DRUID; break;
|
||||
case 2: iPackage = PACKAGE_DRUID_DEATH; break;
|
||||
case 3: iPackage = PACKAGE_DRUID_GRAY; break;
|
||||
case 4: iPackage = PACKAGE_DRUID_HAWKMASTER; break;
|
||||
case 5: iPackage = PACKAGE_DRUID_INTERLOPER; break;
|
||||
case 6: iPackage = PACKAGE_DRUID_SHIFTER; break;
|
||||
}
|
||||
break;
|
||||
case CLASS_TYPE_BARD:
|
||||
iRandom=d8(1);
|
||||
switch (iRandom)
|
||||
{
|
||||
case 1: iPackage = PACKAGE_BARD; break;
|
||||
case 2: iPackage = PACKAGE_BARD_BLADE; break;
|
||||
case 3: iPackage = PACKAGE_BARD_GALLANT; break;
|
||||
case 4: iPackage = PACKAGE_BARD_HARPER; break;
|
||||
case 5: iPackage = PACKAGE_BARD_JESTER; break;
|
||||
case 6: iPackage = PACKAGE_BARD_LOREMASTER; break;
|
||||
case 7: iPackage = PACKAGE_NPC_BARD; break;
|
||||
case 8: iPackage = PACKAGE_NPC_BARD_FIGHTER; break;
|
||||
}
|
||||
break;
|
||||
case CLASS_TYPE_BARBARIAN:
|
||||
iRandom=d8(1);
|
||||
switch (iRandom)
|
||||
{
|
||||
case 1: iPackage = PACKAGE_BARBARIAN; break;
|
||||
case 2: iPackage = PACKAGE_BARBARIAN_BLACKGUARD; break;
|
||||
case 3: iPackage = PACKAGE_BARBARIAN_BRUTE; break;
|
||||
case 4: iPackage = PACKAGE_BARBARIAN_ORCBLOOD; break;
|
||||
case 5: iPackage = PACKAGE_BARBARIAN_SAVAGE; break;
|
||||
case 6: iPackage = PACKAGE_BARBARIAN_SLAYER; break;
|
||||
case 7: iPackage = PACKAGE_NPC_BARBARIAN_DAELAN; break;
|
||||
case 8: iPackage = PACKAGE_BARBARIAN; break;
|
||||
}
|
||||
break;
|
||||
case CLASS_TYPE_FIGHTER:
|
||||
iRandom=d8(1);
|
||||
switch (iRandom)
|
||||
{
|
||||
case 1: iPackage = PACKAGE_FIGHTER; break;
|
||||
case 2: iPackage = PACKAGE_FIGHTER_COMMANDER; break;
|
||||
case 3: iPackage = PACKAGE_FIGHTER_FINESSE; break;
|
||||
case 4: iPackage = PACKAGE_FIGHTER_GLADIATOR; break;
|
||||
case 5: iPackage = PACKAGE_FIGHTER_PIRATE; break;
|
||||
case 6: iPackage = PACKAGE_FIGHTER_WEAPONMASTER; break;
|
||||
case 7: iPackage = PACKAGE_NPC_FT_WEAPONMASTER; break;
|
||||
case 8: iPackage = PACKAGE_NPC_BARD_FIGHTER; break;
|
||||
}
|
||||
break;
|
||||
case CLASS_TYPE_MONK:
|
||||
iRandom=Random(6)+1;
|
||||
switch (iRandom)
|
||||
{
|
||||
case 1: iPackage = PACKAGE_MONK; break;
|
||||
case 2: iPackage = PACKAGE_MONK_ASSASSIN; break;
|
||||
case 3: iPackage = PACKAGE_MONK_DEVOUT; break;
|
||||
case 4: iPackage = PACKAGE_MONK_GIFTED; break;
|
||||
case 5: iPackage = PACKAGE_MONK_PEASANT; break;
|
||||
case 6: iPackage = PACKAGE_MONK_SPIRIT; break;
|
||||
}
|
||||
break;
|
||||
case CLASS_TYPE_PALADIN:
|
||||
iRandom=d8(1);
|
||||
switch (iRandom)
|
||||
{
|
||||
case 1: iPackage = PACKAGE_PALADIN; break;
|
||||
case 2: iPackage = PACKAGE_PALADIN_CHAMPION; break;
|
||||
case 3: iPackage = PACKAGE_PALADIN_DIVINE; break;
|
||||
case 4: iPackage = PACKAGE_PALADIN_ERRANT; break;
|
||||
case 5: iPackage = PACKAGE_PALADIN_INQUISITOR; break;
|
||||
case 6: iPackage = PACKAGE_PALADIN_UNDEAD; break;
|
||||
case 7: iPackage = PACKAGE_PALADIN_DIVINE_2NDCLASS; break;
|
||||
case 8: iPackage = PACKAGE_NPC_ARIBETH_PALADIN; break;
|
||||
}
|
||||
break;
|
||||
case CLASS_TYPE_RANGER:
|
||||
iRandom=d6(1);
|
||||
switch (iRandom)
|
||||
{
|
||||
case 1: iPackage = PACKAGE_RANGER; break;
|
||||
case 2: iPackage = PACKAGE_RANGER_ARCANEARCHER; break;
|
||||
case 3: iPackage = PACKAGE_RANGER_GIANTKILLER; break;
|
||||
case 4: iPackage = PACKAGE_RANGER_MARKSMAN; break;
|
||||
case 5: iPackage = PACKAGE_RANGER_STALKER; break;
|
||||
case 6: iPackage = PACKAGE_RANGER_WARDEN; break;
|
||||
}
|
||||
break;
|
||||
case CLASS_TYPE_ROGUE:
|
||||
iRandom=d8(1);
|
||||
switch (iRandom)
|
||||
{
|
||||
case 1: iPackage = PACKAGE_ROGUE; break;
|
||||
case 2: iPackage = PACKAGE_ROGUE_BANDIT; break;
|
||||
case 3: iPackage = PACKAGE_ROGUE_GYPSY; break;
|
||||
case 4: iPackage = PACKAGE_ROGUE_SCOUT; break;
|
||||
case 5: iPackage = PACKAGE_ROGUE_SHADOWDANCER; break;
|
||||
case 6: iPackage = PACKAGE_ROGUE_SWASHBUCKLER; break;
|
||||
case 7: iPackage = PACKAGE_NPC_ROGUE; break;
|
||||
case 8: iPackage = PACKAGE_NPC_RG_SHADOWDANCER; break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return iPackage;
|
||||
}
|
22
_module/nss/ra_slp_2d4_min.nss
Normal file
22
_module/nss/ra_slp_2d4_min.nss
Normal file
@@ -0,0 +1,22 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Sleep 2d4 Minutes
|
||||
//:: ra_slp_2d4_min.nss
|
||||
//:: Copyright (c) 2023 Project RATDOG
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Character is rendered unconscious for
|
||||
2d4 minutes.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jaysyn
|
||||
//:: Created On: 20230811
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
object oTarget = OBJECT_SELF;
|
||||
effect eSleep = EffectSleep();
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
|
||||
effect eLink = EffectLinkEffects(eSleep, eVis);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(d4(2)));
|
||||
}
|
18
_module/nss/sc_ds_charm_cnv.nss
Normal file
18
_module/nss/sc_ds_charm_cnv.nss
Normal file
@@ -0,0 +1,18 @@
|
||||
// sc_ds_charm_cnv.nss
|
||||
// by: Tsurani.Nevericy
|
||||
|
||||
#include "utl_i_parameters"
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
object oSelf = OBJECT_SELF;
|
||||
int nRacial = GetRacialType(oSelf);
|
||||
|
||||
int nVal = ConstantStringToInt(GetScriptParam("iRacialType"));
|
||||
|
||||
if (nVal == nRacial)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
@@ -50,7 +50,7 @@ switch (nTable)
|
||||
break;
|
||||
|
||||
case 5: // Shadows
|
||||
SetLocalString(oArea, sEncNum, "v2, night, 7, creature, RA_SHADOW001, 2-12, random, 1.0, 1, 1");
|
||||
SetLocalString(oArea, sEncNum, "v2, night, 7, creature, SHADOW001, 2-12, random, 1.0, 1, 1");
|
||||
break;
|
||||
|
||||
case 6: // Orge & Bugbears
|
||||
|
109
_module/nss/utl_i_parameters.nss
Normal file
109
_module/nss/utl_i_parameters.nss
Normal file
@@ -0,0 +1,109 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Utility Include: Parameters
|
||||
//:: utl_i_parameters.nss
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
These are helper functions for the NWN:EE Script Parameter
|
||||
functions SetScriptParam and GetScriptParam.
|
||||
|
||||
Example:
|
||||
|
||||
// Conversation action script to apply a permanent effect to the given ability score by the given amount
|
||||
void main()
|
||||
{
|
||||
string sAbilityScore = GetScriptParam("ABILITY");
|
||||
int nAbility = ConstantStringToInt(sAbilityScore, -1);
|
||||
// Error checking
|
||||
if(nAbility == -1)
|
||||
{
|
||||
SpeakString("Error, invalid ability score:" + sAbilityScore);
|
||||
return;
|
||||
}
|
||||
int nAmount = StringToInt(GetScriptParam("AMOUNT"));
|
||||
if(nAmount < 0 || nAmount > 10)
|
||||
{
|
||||
SpeakString("Error, invalid ability score amount:" + IntToString(nAmount));
|
||||
return;
|
||||
}
|
||||
// Apply effect
|
||||
effect eEffect = EffectAbilityIncrease(nAbility, nAmount);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, GetPCSpeaker());
|
||||
}
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Part of the nwscript_utility_scripts project; see for dates/creator info
|
||||
//:: https://github.com/Finaldeath/nwscript_utility_scripts
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
// This function will convert a string of a constant name into an integer.
|
||||
// Only constants in nwscript.nss will be returned.
|
||||
// Example: "ABILITY_INTELLIGENCE" will get converted to the integer 3
|
||||
// Use this to convert script params into usable values.
|
||||
// * sConstantName - The name of a constant to convert
|
||||
// * nErrorValue - The value to return if the constant isn't found. Default: 0
|
||||
int ConstantStringToInt(string sConstantName, int nErrorValue = 0);
|
||||
|
||||
// This function will convert a string of a constant name into an float.
|
||||
// Only constants in nwscript.nss will be returned.
|
||||
// Example: "RADIUS_SIZE_SMALL" will get converted to the float 1.67
|
||||
// Use this to convert script params into usable values.
|
||||
// * sConstantName - The name of a constant to convert
|
||||
// * nErrorValue - The value to return if the constant isn't found. Default: 0.0
|
||||
float ConstantStringToFloat(string sConstantName, float fErrorValue = 0.0);
|
||||
|
||||
// This function will convert a string of a constant name into a string.
|
||||
// Only constants in nwscript.nss will be returned.
|
||||
// Example: "TILESET_RESREF_BEHOLDER_CAVES" will get converted to the string "tib01"
|
||||
// Use this to convert script params into usable values.
|
||||
// * sConstantName - The name of a constant to convert
|
||||
// * sErrorValue - The value to return if the constant isn't found. Default: ""
|
||||
string ConstantStringToString(string sConstantName, string sErrorValue = "");
|
||||
|
||||
|
||||
// This function will convert a string of a constant name into an integer.
|
||||
// Only constants in nwscript.nss will be returned.
|
||||
// Example: "ABILITY_INTELLIGENCE" will get converted to the integer 3
|
||||
// Use this to convert script params into usable values.
|
||||
// * sConstantName - The name of a constant to convert
|
||||
// * nErrorValue - The value to return if the constant isn't found. Default: 0
|
||||
int ConstantStringToInt(string sConstantName, int nErrorValue = 0)
|
||||
{
|
||||
// This is the error return value being set in case ExecuteScriptChunk fails.
|
||||
SetLocalInt(GetModule(), "CONVERTED_SCRIPT_PARAM", nErrorValue);
|
||||
// From the example this does SetLocalInt(GetModule(), "CONVERTED_SCRIPT_PARAM", ABILITY_INTELLIGENCE);
|
||||
ExecuteScriptChunk("SetLocalInt(GetModule(), \"CONVERTED_SCRIPT_PARAM\", " + sConstantName + ");", GetModule());
|
||||
// Returns the value set, or nErrorValue if none was set
|
||||
return GetLocalInt(GetModule(), "CONVERTED_SCRIPT_PARAM");
|
||||
}
|
||||
|
||||
// This function will convert a string of a constant name into an float.
|
||||
// Only constants in nwscript.nss will be returned.
|
||||
// Example: "RADIUS_SIZE_SMALL" will get converted to the float 1.67
|
||||
// Use this to convert script params into usable values.
|
||||
// * sConstantName - The name of a constant to convert
|
||||
// * fErrorValue - The value to return if the constant isn't found. Default: 0.0
|
||||
float ConstantStringToFloat(string sConstantName, float fErrorValue = 0.0)
|
||||
{
|
||||
// This is the error return value being set in case ExecuteScriptChunk fails.
|
||||
SetLocalFloat(GetModule(), "CONVERTED_SCRIPT_PARAM", fErrorValue);
|
||||
// From the example this does SetLocalFloat(GetModule(), "CONVERTED_SCRIPT_PARAM", RADIUS_SIZE_SMALL);
|
||||
ExecuteScriptChunk("SetLocalFloat(GetModule(), \"CONVERTED_SCRIPT_PARAM\", " + sConstantName + ");", GetModule());
|
||||
// Returns the value set, or fErrorValue if none was set
|
||||
return GetLocalFloat(GetModule(), "CONVERTED_SCRIPT_PARAM");
|
||||
}
|
||||
|
||||
// This function will convert a string of a constant name into a string.
|
||||
// Only constants in nwscript.nss will be returned.
|
||||
// Example: "TILESET_RESREF_BEHOLDER_CAVES" will get converted to the string "tib01"
|
||||
// Use this to convert script params into usable values.
|
||||
// * sConstantName - The name of a constant to convert
|
||||
// * sErrorValue - The value to return if the constant isn't found. Default: ""
|
||||
string ConstantStringToString(string sConstantName, string sErrorValue = "")
|
||||
{
|
||||
// This is the error return value being set in case ExecuteScriptChunk fails.
|
||||
SetLocalString(GetModule(), "CONVERTED_SCRIPT_PARAM", sErrorValue);
|
||||
// From the example this does SetLocalString(GetModule(), "CONVERTED_SCRIPT_PARAM", TILESET_RESREF_BEHOLDER_CAVES);
|
||||
ExecuteScriptChunk("SetLocalString(GetModule(), \"CONVERTED_SCRIPT_PARAM\", " + sConstantName + ");", GetModule());
|
||||
// Returns the value set, or sErrorValue if none was set
|
||||
return GetLocalString(GetModule(), "CONVERTED_SCRIPT_PARAM");
|
||||
}
|
Reference in New Issue
Block a user